SPOPS::DBI::SQLite -- SQLite-specific code for DBI collections
myobject => { isa => [ qw( SPOPS::DBI::SQLite SPOPS::DBI ) ], increment_field => 1, id_field => 'id', no_insert => [ 'id' ], };
This just implements some SQLite-specific routines so we can abstract them out.
One of these items is to auto-generate keys. SQLite supports auto-generated keys in one instance only -- when you specify the first column as an integer field (not int, for some reason SQLite is sensitive to this) and as the primary key. For the value to be generated, you should not insert a value for it.
integer
int
So to use auto-generated keys, just define your table:
CREATE TABLE my_table ( id integer not null primary key, ... )
or
CREATE TABLE my_table ( id integer not null, ... primary key ( id ) )
And tell SPOPS you are using an auto-increment field:
NOTE: Since SQLite is typeless, we assume for quoting purposes that everything is a SQL_VARCHAR type of field.
SQL_VARCHAR
None known.
Nothing known.
DBD::SQLite
DBI
Copyright (c) 2002 intes.net, inc.. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris Winters <chris@cwinters.com>
To install SPOPS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPOPS
CPAN shell
perl -MCPAN -e shell install SPOPS
For more information on module installation, please visit the detailed CPAN module installation guide.