8 { # Fake storage driver for SQLite + no bind variables
9 package DBICTest::SQLite::NoBindVars;
11 DBIx::Class::Storage::DBI::NoBindVars
12 DBIx::Class::Storage::DBI::SQLite
17 my $schema = DBICTest->init_schema (storage_type => 'DBICTest::SQLite::NoBindVars', no_populate => 1);
19 # test primary key handling
20 my $new = $schema->resultset('Artist')->create({ name => 'foo' });
21 ok($new->artistid, "Auto-PK worked");
25 $schema->resultset('Artist')->create({ name => 'Artist ' . $_ });
27 my $it = $schema->resultset('Artist')->search( {},
30 order_by => 'artistid' }
33 is( $it->count, 3, "LIMIT count ok" ); # ask for 3 rows out of 7 artists
35 $schema->is_executed_sql_bind( sub {
36 is( $it->next->name, "Artist 2", "iterator->next ok" );
39 is( $it->next, undef, "next past end of resultset ok" );
41 [ 'SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me ORDER BY artistid LIMIT 3 OFFSET 2' ],
42 ], 'Correctly interpolated SQL' );