SPOPS::DBI::SQLite - SQLite-specific code for DBI collections


SPOPS documentation  | view source Contained in the SPOPS distribution.

Index


NAME

Top

SPOPS::DBI::SQLite -- SQLite-specific code for DBI collections

SYNOPSIS

Top

 myobject => {
   isa             => [ qw( SPOPS::DBI::SQLite SPOPS::DBI ) ],
   increment_field => 1,
   id_field        => 'id',
   no_insert       => [ 'id' ],
 };

DESCRIPTION

Top

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.

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:

 myobject => {
   isa             => [ qw( SPOPS::DBI::SQLite SPOPS::DBI ) ],
   increment_field => 1,
   id_field        => 'id',
   no_insert       => [ 'id' ],
 };

NOTE: Since SQLite is typeless, we assume for quoting purposes that everything is a SQL_VARCHAR type of field, overriding db_discover_types from SPOPS::SQLInterface with our own version.

BUGS

Top

None known.

TO DO

Top

Nothing known.

SEE ALSO

Top

DBD::SQLite

DBI

COPYRIGHT

Top

AUTHORS

Top

Chris Winters <chris@cwinters.com>


SPOPS documentation  | view source Contained in the SPOPS distribution.