David E. Wheeler wrote:
On Oct 5, 2009, at 5:01 AM, Tim Bunce wrote:
I'd be interested if someone could do the research to list what
databases support savepoints and what syntax they use for the main
statements.

DBIx::Class has done this for a lot of databases. Check out

MSSQL:
    SAVE TRANSACTION $name;
    ROLLBACK TRANSACTION $name;

MySQL:
    SAVEPOINT $name;
    RELEASE SAVEPOINT $name;
    ROLLBACK TO SAVEPOINT $name;

Oracle:
    SAVEPOINT $name;
    ROLLBACK TO SAVEPOINT $name;

Pg:
    $dbh->pg_savepoint($name);
    $dbh->pg_release($name);
    $dbh->pg_rollback_to($name);

SQLite also has savepoints, since 3.6.8 around January.

See http://sqlite.org/lang_savepoint.html for details.

SQLite:
    SAVEPOINT $name
    RELEASE [SAVEPOINT] $name
    ROLLBACK [TRANSACTION] TO [SAVEPOINT] $name

Adding that to DBIx::Class shouldn't be difficult.

-- Darren Duncan

Reply via email to