NAME

SQL::DB::Sequence - SQL::DB Role for sequence support

VERSION

0.97_2. Development release.

SYNOPSIS

use SQL::DB;
use SQL::DB::Sequence;

my $db = SQL::DB->connect($dsn);

$db->create_sequence('myseq');
my $id = $db->nextval('myseq');

DESCRIPTION

SQL::DB::Sequence is a Role class providing SQL sequence support for SQL::DB.

METHODS

create_sequence( $name )

Creates a sequence in the database. Takes the same arguments as Sequences are emulated on SQLite, used directly for PostgreSQL, and are unsupported for everything else.

$db->create_sequence( 'myseq' );
nextval( $name ) -> Int

Advance the sequence to its next value and return that value. If $count is specified then a array of $count values are returned and the sequence incremented appropriately. Sequences are emulated on SQLite, used directly for PostgreSQL, and are unsupported for everything else.

setval( $name, $value )

Unimplemented.

drop_sequence( $name )

Unimplemented.

SEE ALSO

SQL::DB, Moo::Role

AUTHOR

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE

Copyright (C) 2011 Mark Lawrence <nomad@null.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.