mirror of
https://github.com/danog/ext-pq.git
synced 2024-11-30 04:19:49 +01:00
transactions
This commit is contained in:
parent
53220e4b7f
commit
01a3a98f9a
9
TODO
9
TODO
@ -3,11 +3,18 @@
|
||||
* LOBs
|
||||
* COPY
|
||||
* pq\Cancel
|
||||
* transaction savepoints
|
||||
* transaction snapshots
|
||||
* notice receiver (else libpq uses stderr)
|
||||
* pq\Event\Notice
|
||||
|
||||
* pq\Event\Result\Create,
|
||||
pq\Event\Result\Destroy,
|
||||
pq\Event\Connection\Reset,
|
||||
pq\Event\Connection\Destroy
|
||||
* fetchInto/fetchCtor?
|
||||
* unlisten?
|
||||
* tracing?
|
||||
* userland event handler?
|
||||
* notice receiver?
|
||||
* pq\Result->__clone through PQcopyResult?
|
||||
* db/pass/user/host/port/options properties on pq\Connection?
|
745
src/php_pq.c
745
src/php_pq.c
File diff suppressed because it is too large
Load Diff
@ -32,13 +32,6 @@ zend_module_entry pq_module_entry;
|
||||
# include "TSRM.h"
|
||||
#endif
|
||||
|
||||
PHP_MINIT_FUNCTION(pq);
|
||||
PHP_MSHUTDOWN_FUNCTION(pq);
|
||||
PHP_RINIT_FUNCTION(pq);
|
||||
PHP_RSHUTDOWN_FUNCTION(pq);
|
||||
PHP_MINFO_FUNCTION(pq);
|
||||
|
||||
|
||||
/*
|
||||
ZEND_BEGIN_MODULE_GLOBALS(pq)
|
||||
long global_value;
|
||||
|
30
tests/trans001.phpt
Normal file
30
tests/trans001.phpt
Normal file
@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
transaction
|
||||
--SKIPIF--
|
||||
<?php include "_skipif.inc"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
|
||||
include "_setup.inc";
|
||||
|
||||
$c = new pq\Connection(PQ_DSN);
|
||||
$t = new pq\Transaction($c);
|
||||
$c->exec("CREATE TABLE test (id serial, data text)");
|
||||
$s = $c->prepare("test_insert", "INSERT INTO test (data) VALUES (\$1)", array($c->types->byName->text->oid));
|
||||
$s->exec(array("a"));
|
||||
$s->exec(array("b"));
|
||||
$s->exec(array("c"));
|
||||
$r = $c->exec("SELECT * FROM test");
|
||||
while ($row = $r->fetchRow(pq\Result::FETCH_OBJECT)) {
|
||||
printf("%d => %s\n", $row->id, $row->data);
|
||||
}
|
||||
$t->rollback();
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
Test
|
||||
1 => a
|
||||
2 => b
|
||||
3 => c
|
||||
DONE
|
Loading…
Reference in New Issue
Block a user