8 eval "use DBD::SQLite";
10 ? ( skip_all => 'needs DBD::SQLite for testing' )
17 DBICTest->init_schema();
19 my $dsn = DBICTest->schema->storage->connect_info->[0];
21 DBICTest->schema->connection($dsn, { quote_char => "'", name_sep => '.' });
23 my $rs = DBICTest::CD->search(
24 { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
25 { join => 'artist' });
27 cmp_ok( $rs->count, '==', 1, "join with fields quoted");
29 $rs = DBICTest::CD->search({},
30 { 'order_by' => 'year DESC'});
33 like( $@, qr/ORDER BY terms/, "Problem with ORDER BY quotes" );
36 my $order = 'year DESC';
37 $rs = DBICTest::CD->search({},
38 { 'order_by' => \$order });
41 local $SIG{__WARN__} = sub { $warnings .= $_[0] };
42 my $first = $rs->first();
43 ok( $warnings !~ /ORDER BY terms/,
44 "No problem handling ORDER by scalaref" );
47 DBICTest->schema->connection($dsn, { quote_char => [qw/[ ]/], name_sep => '.' });
49 $rs = DBICTest::CD->search(
50 { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
51 { join => 'artist' });
52 cmp_ok($rs->count,'==', 1,"join quoted with brackets.");
59 DBICTest->schema->connection($dsn, { quote_char => '`', name_sep => '.' });
61 cmp_ok(DBICTest->schema->storage->sql_maker->update('group', \%data), 'eq', 'UPDATE `group` SET `name` = ?, `order` = ?', "quoted table names for UPDATE");