dbix::class::storage::dbi::sqlite5.18(3) [mojave man page]
DBIx::Class::Storage::DBI::SQLite(3) User Contributed Perl Documentation DBIx::Class::Storage::DBI::SQLite(3)NAME
DBIx::Class::Storage::DBI::SQLite - Automatic primary key class for SQLite
SYNOPSIS
# In your table classes
use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
DESCRIPTION
This class implements autoincrements for SQLite.
Known Issues
RT79576
NOTE - This section applies to you only if ALL of these are true:
* You are or were using DBD::SQLite with a version lesser than 1.38_01
* You are or were using DBIx::Class versions between 0.08191 and 0.08209
(inclusive) or between 0.08240-TRIAL and 0.08242-TRIAL (also inclusive)
* You use objects with overloaded stringification and are feeding them
to DBIC CRUD methods directly
An unfortunate chain of events led to DBIx::Class silently hitting the problem described in RT#79576
<https://rt.cpan.org/Public/Bug/Display.html?id=79576>.
In order to trigger the bug condition one needs to supply more than one bind value that is an object with overloaded stringification
(numification is not relevant, only stringification is). When this is the case the internal DBIx::Class call to "$sth->bind_param"
would be executed in a way that triggers the above-mentioned DBD::SQLite bug. As a result all the logs and tracers will contain the
expected values, however SQLite will receive all these bind positions being set to the value of the last supplied stringifiable object.
Even if you upgrade DBIx::Class (which works around the bug starting from version 0.08210) you may still have corrupted/incorrect data
in your database. DBIx::Class will currently detect when this condition (more than one stringifiable object in one CRUD call) is
encountered and will issue a warning pointing to this section. This warning will be removed 2 years from now, around April 2015, You
can disable it after you've audited your data by setting the "DBIC_RT79576_NOWARN" environment variable. Note - the warning is emitted
only once per callsite per process and only when the condition in question is encountered. Thus it is very unlikely that your logsystem
will be flooded as a result of this.
METHODS
connect_call_use_foreign_keys
Used as:
on_connect_call => 'use_foreign_keys'
In connect_info to turn on foreign key (including cascading) support for recent versions of SQLite and DBD::SQLite.
Executes:
PRAGMA foreign_keys = ON
See <http://www.sqlite.org/foreignkeys.html> for more information.
AUTHOR AND CONTRIBUTORS
See AUTHOR and CONTRIBUTORS in DBIx::Class
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.18.2 2014-01-29 DBIx::Class::Storage::DBI::SQLite(3)
Check Out this Related Man Page
SQL::Translator::Parser::DBIx::Class(3) User Contributed Perl Documentation SQL::Translator::Parser::DBIx::Class(3)NAME
SQL::Translator::Parser::DBIx::Class - Create a SQL::Translator schema from a DBIx::Class::Schema instance
SYNOPSIS
## Via DBIx::Class
use MyApp::Schema;
my $schema = MyApp::Schema->connect("dbi:SQLite:something.db");
$schema->create_ddl_dir();
## or
$schema->deploy();
## Standalone
use MyApp::Schema;
use SQL::Translator;
my $schema = MyApp::Schema->connect;
my $trans = SQL::Translator->new (
parser => 'SQL::Translator::Parser::DBIx::Class',
parser_args => {
package => $schema,
add_fk_index => 0,
sources => [qw/
Artist
CD
/],
},
producer => 'SQLite',
) or die SQL::Translator->error;
my $out = $trans->translate() or die $trans->error;
DESCRIPTION
This class requires SQL::Translator installed to work.
"SQL::Translator::Parser::DBIx::Class" reads a DBIx::Class schema, interrogates the columns, and stuffs it all in an $sqlt_schema object.
Its primary use is in deploying database layouts described as a set of DBIx::Class classes, to a database. To do this, see "deploy" in
DBIx::Class::Schema.
This can also be achieved by having DBIx::Class export the schema as a set of SQL files ready for import into your database, or passed to
other machines that need to have your application installed but don't have SQL::Translator installed. To do this see "create_ddl_dir" in
DBIx::Class::Schema.
PARSER OPTIONS
add_fk_index
Create an index for each foreign key. Enabled by default, as having indexed foreign key columns is normally the sensible thing to do.
sources
Arguments: @class_names
Limit the amount of parsed sources by supplying an explicit list of source names.
SEE ALSO
SQL::Translator, DBIx::Class::Schema
AUTHORS
See "CONTRIBUTORS" in DBIx::Class.
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.16.2 2012-08-16 SQL::Translator::Parser::DBIx::Class(3)