From 24c14516372db9a6385450e9db0b13efa8684f88 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Mon, 15 Dec 2014 00:50:09 +0000 Subject: [PATCH] Docs for PR#3 --- pq/Statement.md | 4 ++++ pq/Statement/deallocate.md | 30 ++++++++++++++++++++++++++++++ pq/Statement/deallocateAsync.md | 15 +++++++++++++++ pq/Statement/prepare.md | 30 ++++++++++++++++++++++++++++++ pq/Statement/prepareAsync.md | 15 +++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 pq/Statement/deallocate.md create mode 100644 pq/Statement/deallocateAsync.md create mode 100644 pq/Statement/prepare.md create mode 100644 pq/Statement/prepareAsync.md 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 + -- 2.30.2