8 use DBIC::SqlMakerTest;
12 my $schema = DBICTest->init_schema(no_deploy => 1);
14 my $sql_maker = $schema->storage->sql_maker;
18 my ($sql, @bind) = $sql_maker->insert(
21 'day' => '2008-11-16',
22 'numbers' => [13, 21, 34, 55, 89]
28 q/INSERT INTO lottery (day, numbers) VALUES (?, ?)/,
29 [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
30 'sql_maker passes arrayrefs in insert'
34 ($sql, @bind) = $sql_maker->update(
37 'day' => '2008-11-16',
38 'numbers' => [13, 21, 34, 55, 89]
44 q/UPDATE lottery SET day = ?, numbers = ?/,
45 [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
46 'sql_maker passes arrayrefs in update'
50 # make sure the cookbook caveat of { $op, \'...' } no longer applies
52 my ($sql, @bind) = $sql_maker->where({
53 last_attempt => \ '< now() - interval "12 hours"',
54 next_attempt => { '<', \ 'now() - interval "12 hours"' },
64 (created <= 1969 OR created > 1984 )
65 AND last_attempt < now() - interval "12 hours"
66 AND next_attempt < now() - interval "12 hours"
72 # Make sure the carp/croak override in SQLA works (via SQLAHacks)
76 $schema->resultset ('Artist')->search ({}, { order_by => { -asc => 'stuff', -desc => 'staff' } } )->as_query;
77 }, qr/$file/, 'Exception correctly croak()ed');