11'use strict' ;
22
3- var Table = require ( __dirname + '/../../lib/table' ) ;
43var Harness = require ( './support' ) ;
54var post = Harness . definePostTable ( ) ;
65var user = Harness . defineUserTable ( ) ;
76
8- var arrayTable = Table . define ( {
9- name : 'arraytest' ,
10- columns : [ 'id' , 'numbers' ]
11- } ) ;
12-
137Harness . test ( {
148 query : post . insert ( post . content . value ( 'test' ) , post . userId . value ( 1 ) ) ,
159 pg : {
@@ -636,43 +630,3 @@ Harness.test({
636630 } ,
637631 params : [ ]
638632} ) ;
639-
640- Harness . test ( {
641- query : arrayTable . insert ( arrayTable . id . value ( 1 ) , arrayTable . numbers . value ( [ 2 , 3 , 4 ] ) ) ,
642- pg : {
643- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES ($1, $2)' ,
644- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, \'{2,3,4}\')'
645- } ,
646- sqlite : {
647- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES ($1, $2)' ,
648- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, (2, 3, 4))'
649- } ,
650- mysql : {
651- text : 'INSERT INTO `arraytest` (`id`, `numbers`) VALUES (?, ?)' ,
652- string : 'INSERT INTO `arraytest` (`id`, `numbers`) VALUES (1, (2, 3, 4))'
653- } ,
654- oracle : {
655- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (:1, :2)' ,
656- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, (2, 3, 4))'
657- }
658- } ) ;
659-
660- Harness . test ( {
661- query : arrayTable . insert ( arrayTable . id . value ( 1 ) , arrayTable . numbers . value ( [ "one" , "two" , "three" ] ) ) ,
662- pg : {
663- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES ($1, $2)' ,
664- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, \'{"one","two","three"}\')'
665- } ,
666- sqlite : {
667- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES ($1, $2)' ,
668- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, (\'one\', \'two\', \'three\'))'
669- } ,
670- mysql : {
671- text : 'INSERT INTO `arraytest` (`id`, `numbers`) VALUES (?, ?)' ,
672- string : 'INSERT INTO `arraytest` (`id`, `numbers`) VALUES (1, (\'one\', \'two\', \'three\'))'
673- } ,
674- oracle : {
675- text : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (:1, :2)' ,
676- string : 'INSERT INTO "arraytest" ("id", "numbers") VALUES (1, (\'one\', \'two\', \'three\'))'
677- }
678- } ) ;
0 commit comments