From: Chris Wright Date: Mon, 15 Dec 2014 00:50:09 +0000 (+0000) Subject: Docs for PR#3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=refs%2Fpull%2F2%2Fhead;p=mdref%2Fmdref-pq Docs for PR#3 --- diff --git a/pq/Statement.md b/pq/Statement.md index 65b10a6..62bd053 100644 --- a/pq/Statement.md +++ b/pq/Statement.md @@ -9,4 +9,8 @@ See pq\Connection::prepare(). The connection to the server. * public (readonly) string $name The identifiying name of the prepared statement. +* public (readonly) string $query + The query string used to prepare the statement. +* public (readonly) array $types + List of corresponding query parameter type OIDs for the prepared statement. diff --git a/pq/Statement/deallocate.md b/pq/Statement/deallocate.md new file mode 100644 index 0000000..6729638 --- /dev/null +++ b/pq/Statement/deallocate.md @@ -0,0 +1,30 @@ +# void pq\Statement::deallocate() + +Free the server resources used by the prepared statement, so it can no longer be executed. +This is done implicitly when the object is destroyed. + +## Params: + +None. + +## Throws: + +* pq\Exception\InvalidArgumentException +* pq\Exception\BadMethodCallException +* pq\Exception\RuntimeException + +## Example: + + prepare("st1", + "SELECT \$1, \$2", [pq\Types::XML, pq\Types::JSON]); + + // some code which executes the statement + + $statement->deallocate(); + + ?> + diff --git a/pq/Statement/deallocateAsync.md b/pq/Statement/deallocateAsync.md new file mode 100644 index 0000000..44297a8 --- /dev/null +++ b/pq/Statement/deallocateAsync.md @@ -0,0 +1,15 @@ +# void pq\Statement::deallocateAsync() + +[Asynchronously](pq/Connection/: Asynchronous Usage) free the server resources used by the +prepared statement, so it can no longer be executed. + +## Params: + +None. + +## Throws: + +* pq\Exception\InvalidArgumentException +* pq\Exception\BadMethodCallException +* pq\Exception\RuntimeException + diff --git a/pq/Statement/prepare.md b/pq/Statement/prepare.md new file mode 100644 index 0000000..8ebde86 --- /dev/null +++ b/pq/Statement/prepare.md @@ -0,0 +1,30 @@ +# void pq\Statement::prepare() + +Re-prepare a statement that has been deallocated. This is a no-op on already open statements. + +## Params: + +None. + +## Throws: + +* pq\Exception\InvalidArgumentException +* pq\Exception\BadMethodCallException +* pq\Exception\RuntimeException + +## Example: + + prepare("st1", + "SELECT \$1, \$2", [pq\Types::XML, pq\Types::JSON]); + + // some code which executes the statement + + $statement->deallocate(); + $statement->prepare(); + + ?> + diff --git a/pq/Statement/prepareAsync.md b/pq/Statement/prepareAsync.md new file mode 100644 index 0000000..59df126 --- /dev/null +++ b/pq/Statement/prepareAsync.md @@ -0,0 +1,15 @@ +# void pq\Statement::prepareAsync() + +[Asynchronously](pq/Connection/: Asynchronous Usage) re-prepare a statement that has been +deallocated. This is a no-op on already open statements. + +## Params: + +None. + +## Throws: + +* pq\Exception\InvalidArgumentException +* pq\Exception\BadMethodCallException +* pq\Exception\RuntimeException +