* Documented using PostgreSQL arrays in Cookbook.
[dbsrgits/DBIx-Class-Historic.git] / t / 95sql_maker.t
index 0971d12..ee6ccdd 100644 (file)
@@ -21,33 +21,38 @@ my $schema = DBICTest->init_schema();
 my $sql_maker = $schema->storage->sql_maker;
 
 
-my ($sql, @bind) = $sql_maker->insert(
-          'lottery',
-          {
-            'day' => '2008-11-16',
-            'numbers' => [13, 21, 34, 55, 89]
-          }
-);
-
-is_same_sql_bind(
-  $sql, \@bind,
-  q/INSERT INTO lottery (day, numbers) VALUES (?, ?)/,
-    [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
-  'sql_maker passes arrayrefs in insert'
-);
-
-
-($sql, @bind) = $sql_maker->update(
-          'lottery',
-          {
-            'day' => '2008-11-16',
-            'numbers' => [13, 21, 34, 55, 89]
-          }
-);
-
-is_same_sql_bind(
-  $sql, \@bind,
-  q/UPDATE lottery SET day = ?, numbers = ?/,
-    [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
-  'sql_maker passes arrayrefs in update'
-);
+SKIP: {
+  skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 2
+    if $SQL::Abstract::VERSION < 1.49;
+
+  my ($sql, @bind) = $sql_maker->insert(
+            'lottery',
+            {
+              'day' => '2008-11-16',
+              'numbers' => [13, 21, 34, 55, 89]
+            }
+  );
+
+  is_same_sql_bind(
+    $sql, \@bind,
+    q/INSERT INTO lottery (day, numbers) VALUES (?, ?)/,
+      [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
+    'sql_maker passes arrayrefs in insert'
+  );
+
+
+  ($sql, @bind) = $sql_maker->update(
+            'lottery',
+            {
+              'day' => '2008-11-16',
+              'numbers' => [13, 21, 34, 55, 89]
+            }
+  );
+
+  is_same_sql_bind(
+    $sql, \@bind,
+    q/UPDATE lottery SET day = ?, numbers = ?/,
+      [ ['day' => '2008-11-16'], ['numbers' => [13, 21, 34, 55, 89]] ],
+    'sql_maker passes arrayrefs in update'
+  );
+}