[Bast-commits] r8852 - in DBIx-Class/0.08/trunk: .
lib/DBIx/Class/SQLAHacks lib/DBIx/Class/Storage/DBI t/sqlahacks
mo at dev.catalyst.perl.org
mo at dev.catalyst.perl.org
Wed Mar 3 11:05:52 GMT 2010
Author: mo
Date: 2010-03-03 11:05:51 +0000 (Wed, 03 Mar 2010)
New Revision: 8852
Added:
DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks/SQLite.pm
DBIx-Class/0.08/trunk/t/sqlahacks/sqlite.t
Modified:
DBIx-Class/0.08/trunk/Changes
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm
Log:
Fix for SQLite to ignore the { for => ... } attribute
Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes 2010-03-02 17:47:43 UTC (rev 8851)
+++ DBIx-Class/0.08/trunk/Changes 2010-03-03 11:05:51 UTC (rev 8852)
@@ -3,6 +3,7 @@
- Fix regression on not properly throwing when $obj->relationship
is unresolvable
- Add has_relationship method to row objects
+ - Fix for SQLite to ignore the { for => ... } attribute
0.08120 2010-02-24 08:58:00 (UTC)
- Make sure possibly overwritten deployment_statements methods in
Added: DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks/SQLite.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks/SQLite.pm (rev 0)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks/SQLite.pm 2010-03-03 11:05:51 UTC (rev 8852)
@@ -0,0 +1,17 @@
+package # Hide from PAUSE
+ DBIx::Class::SQLAHacks::SQLite;
+
+use base qw( DBIx::Class::SQLAHacks );
+use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/;
+
+#
+# SQLite does not understand SELECT ... FOR UPDATE
+# Adjust SQL here instead
+#
+sub select {
+ my $self = shift;
+ local $self->{_dbic_rs_attrs}{for} = undef;
+ return $self->SUPER::select (@_);
+}
+
+1;
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm 2010-03-02 17:47:43 UTC (rev 8851)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm 2010-03-03 11:05:51 UTC (rev 8852)
@@ -10,6 +10,8 @@
use File::Copy;
use File::Spec;
+__PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::SQLite');
+
sub backup
{
my ($self, $dir) = @_;
Added: DBIx-Class/0.08/trunk/t/sqlahacks/sqlite.t
===================================================================
--- DBIx-Class/0.08/trunk/t/sqlahacks/sqlite.t (rev 0)
+++ DBIx-Class/0.08/trunk/t/sqlahacks/sqlite.t 2010-03-03 11:05:51 UTC (rev 8852)
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+use DBIC::SqlMakerTest;
+
+my $schema = DBICTest->init_schema;
+
+is_same_sql_bind(
+ $schema->resultset('Artist')->search ({}, {for => 'update'})->as_query,
+ "(SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me)", []);
+
+done_testing;
More information about the Bast-commits
mailing list