[Dbix-class] Get next val from sequence

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Dec 6 08:49:41 GMT 2012


On Wed, Dec 05, 2012 at 12:42:56PM -0800, Bill Moseley wrote:
> I'm using Postgresql.  Can someone pont me to docs on fetching nextval?

There is no public interface for this, since everyone who asked for a 
generic "fetch sequence" API never delivered a proposal how it would 
actually work.

The code is mostly there - observe the {auto_nextval} codepath
::Storage::DBI::insert() => ::Storage::DBI::_prefetch_autovalues

Of course if you just chose to use the private methods as is - make sure 
you write tests to catch when your code breaks - these internal names 
*will* change.

> 
> Thanks,
> 
> -- 
> Bill Moseley
> moseley at hank.org

> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk




More information about the DBIx-Class mailing list