Docs for PR#3 2/head
authorChris Wright <daverandom@php.net>
Mon, 15 Dec 2014 00:50:09 +0000 (00:50 +0000)
committerChris Wright <daverandom@php.net>
Mon, 15 Dec 2014 00:51:21 +0000 (00:51 +0000)
pq/Statement.md
pq/Statement/deallocate.md [new file with mode: 0644]
pq/Statement/deallocateAsync.md [new file with mode: 0644]
pq/Statement/prepare.md [new file with mode: 0644]
pq/Statement/prepareAsync.md [new file with mode: 0644]

index 65b10a6ed7e381ead1aea89caf3c3ca19b59f677..62bd0531e151bb9111fb826507872de2ee7fcf6a 100644 (file)
@@ -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 (file)
index 0000000..6729638
--- /dev/null
@@ -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:
+
+        <?php
+
+        $connection = new pq\Connection;
+        $types = new pq\Types($connection);
+        $statement = $connection->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 (file)
index 0000000..44297a8
--- /dev/null
@@ -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 (file)
index 0000000..8ebde86
--- /dev/null
@@ -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:
+
+        <?php
+
+        $connection = new pq\Connection;
+        $types = new pq\Types($connection);
+        $statement = $connection->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 (file)
index 0000000..59df126
--- /dev/null
@@ -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
+