mojolicious / mojo-pg

Mojolicious :heart: PostgreSQL
https://metacpan.org/release/Mojo-Pg
Artistic License 2.0
99 stars 46 forks source link

added helpers for work with savepoints #10

Closed avkhozov closed 9 years ago

kraih commented 9 years ago

I've never used savepoints, not sure how useful they are, lets see if more folks are interested.

kraih commented 9 years ago

I don't know if savepoints are common enough to deserve their own methods, but i have to give this a :-1: because of the upsert example, which will be pointless after PostgreSQL 9.5.

avkhozov commented 9 years ago

Ok, but on conflict do check only one class of errors. And I don't understand how to solve what should be in the module Mojo::Pg, and what is not. For example pid and ping methods of Mojo::Pg::Database more useful that savepoints? All these methods are very easy to make using dbh.

kraih commented 9 years ago

Think pid and ping were added because they are needed in tests, which is a strong use case.

jhthorsen commented 9 years ago

I don't see the benefit, since it seems easy enough to just do $db->dbh->pg_savepoint("sp1") directly.