Re: Savepoints

Darren Duncan <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.