From: Rafael Kitover Date: Wed, 17 Mar 2010 10:49:51 +0000 (+0000) Subject: add connect_call_use_foreign_keys for SQLite X-Git-Tag: v0.08121~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=732e4282dee4d209f902e3bd4548faf7f42ebcdd;p=dbsrgits%2FDBIx-Class.git add connect_call_use_foreign_keys for SQLite --- diff --git a/lib/DBIx/Class/Storage/DBI/SQLite.pm b/lib/DBIx/Class/Storage/DBI/SQLite.pm index d096d80..147324d 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLite.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLite.pm @@ -62,6 +62,31 @@ sub deployment_statements { sub datetime_parser_type { return "DateTime::Format::SQLite"; } +=head2 connect_call_use_foreign_keys + +Used as: + + on_connect_call => 'use_foreign_keys' + +In L to turn on foreign key (including +cascading) support for recent versions of SQLite and L. + +Executes: + + PRAGMA foreign_keys = ON + +See L for more information. + +=cut + +sub connect_call_use_foreign_keys { + my $self = shift; + + $self->_do_query( + 'PRAGMA foreign_keys = ON' + ); +} + 1; =head1 NAME