... | ... |
@@ -3006,4 +3006,13 @@ $rows = $dbi->select( |
3006 | 3006 |
)->all; |
3007 | 3007 |
is_deeply($rows, [{key1 => 1}]); |
3008 | 3008 |
|
3009 |
+eval { |
|
3010 |
+$dbi->select( |
|
3011 |
+ table => 'table1', |
|
3012 |
+ column => 'key1', |
|
3013 |
+ wrap => 'select * from (' |
|
3014 |
+) |
|
3015 |
+}; |
|
3016 |
+like($@, qr/array/); |
|
3017 |
+ |
|
3009 | 3018 |
1; |
... | ... |
@@ -211,28 +211,6 @@ $dbi->execute("insert into table1 (key1) values (:table2.key1)", {'table2.key1' |
211 | 211 |
$result = $dbi->select(table => 'table1'); |
212 | 212 |
is($result->one->{key1}, 'A'); |
213 | 213 |
|
214 |
-test 'select() wrap option'; |
|
215 |
-$dbi = DBIx::Custom->connect; |
|
216 |
-eval { $dbi->execute('drop table table1') }; |
|
217 |
-$dbi->execute($create_table1); |
|
218 |
-$dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2}); |
|
219 |
-$dbi->insert(table => 'table1', param => {key1 => 2, key2 => 3}); |
|
220 |
-$rows = $dbi->select( |
|
221 |
- table => 'table1', |
|
222 |
- column => 'key1', |
|
223 |
- wrap => ['select * from (', ') as t where key1 = 1'] |
|
224 |
-)->all; |
|
225 |
-is_deeply($rows, [{key1 => 1}]); |
|
226 |
- |
|
227 |
-eval { |
|
228 |
-$dbi->select( |
|
229 |
- table => 'table1', |
|
230 |
- column => 'key1', |
|
231 |
- wrap => 'select * from (' |
|
232 |
-) |
|
233 |
-}; |
|
234 |
-like($@, qr/array/); |
|
235 |
- |
|
236 | 214 |
test 'dbi method from model'; |
237 | 215 |
$dbi = MyDBI9->connect; |
238 | 216 |
eval { $dbi->execute('drop table table1') }; |