Socket
Socket
Sign inDemoInstall

sql

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql - npm Package Compare versions

Comparing version 0.55.0 to 0.56.0

lib/dialect/oracle.js

2

lib/dialect/index.js

@@ -14,2 +14,4 @@ 'use strict';

return require('./mssql');
case 'oracle':
return require('./oracle');
default:

@@ -16,0 +18,0 @@ throw new Error(dialect + ' is unsupported');

21

lib/dialect/postgres.js

@@ -165,2 +165,4 @@ 'use strict';

Postgres.prototype._quoteCharacter = '"';
Postgres.prototype._aliasText = ' AS ';
Postgres.prototype.quote = function(word, quoteCharacter) {

@@ -300,3 +302,3 @@ var q;

Postgres.prototype.visitAlias = function(alias) {
var result = [this.visit(alias.value) + ' AS ' + this.quote(alias.alias)];
var result = [this.visit(alias.value) + this._aliasText + this.quote(alias.alias)];
return result;

@@ -641,3 +643,3 @@ };

if(table.alias) {
txt += ' AS ' + this.quote(table.alias);
txt += this._aliasText + this.quote(table.alias);
}

@@ -699,3 +701,3 @@ return [txt];

hasAliases = hasAliases || aliased;
allCols.push(tableName + this.quote(col.name) + (aliased ? ' AS ' + this.quote(col.alias || col.property) : ''));
allCols.push(tableName + this.quote(col.name) + (aliased ? this._aliasText + this.quote(col.alias || col.property) : ''));
}

@@ -722,3 +724,3 @@ }

if(inSelectClause && (columnNode.alias || columnNode.property !== columnNode.name)) {
txt.push(' AS ' + this.quote(columnNode.alias || columnNode.property));
txt.push(this._aliasText + this.quote(columnNode.alias || columnNode.property));
}

@@ -755,4 +757,9 @@ if(this._visitingCreate || this._visitingAddColumn) {

' require a table and column)');
txt.push(' REFERENCES ' + columnNode.references.table + '(' +
columnNode.references.column + ')');
txt.push(' REFERENCES ');
if(columnNode.references.schema) {
txt.push(this.quote(columnNode.references.schema) + '.');
}
txt.push(this.quote(columnNode.references.table) + '(' +
this.quote(columnNode.references.column) + ')');
if (!!columnNode.references.onDelete) {

@@ -849,3 +856,3 @@ if (columnNode.references.onDelete.toUpperCase() === "CASCADE" ||

if(node.alias) {
txt.push(' AS ' + this.quote(node.alias));
txt.push(this._aliasText + this.quote(node.alias));
}

@@ -852,0 +859,0 @@ return [txt.join('')];

@@ -5,3 +5,3 @@ {

"description": "sql builder",
"version": "0.55.0",
"version": "0.56.0",
"homepage": "https://github.com/brianc/node-sql",

@@ -8,0 +8,0 @@ "repository": {

# node-sql
_sql string builder for node_ - supports PostgreSQL, mysql, Microsoft SQL Server, and sqlite dialects.
_sql string builder for node_ - supports PostgreSQL, mysql, Microsoft SQL Server, Oracle and sqlite dialects.

@@ -4,0 +4,0 @@ Building SQL statements by hand is no fun, especially in a language which has clumsy support for multi-line strings.

@@ -26,2 +26,6 @@ 'use strict';

},
oracle: {
text : 'SELECT COUNT(*) "post_count" FROM "post"',
string: 'SELECT COUNT(*) "post_count" FROM "post"'
},
params: []

@@ -48,2 +52,6 @@ });

},
oracle: {
text : 'SELECT COUNT(*) "post_count" FROM "post"',
string: 'SELECT COUNT(*) "post_count" FROM "post"'
},
params: []

@@ -70,2 +78,6 @@ });

},
oracle: {
text : 'SELECT COUNT(*) "post_amount" FROM "post"',
string: 'SELECT COUNT(*) "post_amount" FROM "post"'
},
params: []

@@ -92,2 +104,6 @@ });

},
oracle: {
text : 'SELECT COUNT("post"."content") "content_count" FROM "post"',
string: 'SELECT COUNT("post"."content") "content_count" FROM "post"'
},
params: []

@@ -114,2 +130,6 @@ });

},
oracle: {
text : 'SELECT COUNT("post"."content") "content_count" FROM "post"',
string: 'SELECT COUNT("post"."content") "content_count" FROM "post"'
},
params: []

@@ -136,2 +156,6 @@ });

},
oracle: {
text : 'SELECT COUNT("post"."content") "content_count" FROM "post"',
string: 'SELECT COUNT("post"."content") "content_count" FROM "post"'
},
params: []

@@ -154,2 +178,6 @@ });

},
oracle: {
text : 'SELECT COUNT(*) "customer_count" FROM "customer"',
string: 'SELECT COUNT(*) "customer_count" FROM "customer"'
},
params: []

@@ -176,2 +204,6 @@ });

},
oracle: {
text : 'SELECT MIN("post"."id") "id_min" FROM "post"',
string: 'SELECT MIN("post"."id") "id_min" FROM "post"'
},
params: []

@@ -198,2 +230,6 @@ });

},
oracle: {
text : 'SELECT MIN("post"."id") "min_id" FROM "post"',
string: 'SELECT MIN("post"."id") "min_id" FROM "post"'
},
params: []

@@ -220,2 +256,6 @@ });

},
oracle: {
text : 'SELECT MIN("post"."id") "min_id" FROM "post"',
string: 'SELECT MIN("post"."id") "min_id" FROM "post"'
},
params: []

@@ -242,2 +282,6 @@ });

},
oracle: {
text : 'SELECT MAX("post"."id") "id_max" FROM "post"',
string: 'SELECT MAX("post"."id") "id_max" FROM "post"'
},
params: []

@@ -264,2 +308,6 @@ });

},
oracle: {
text : 'SELECT MAX("post"."id") "max_id" FROM "post"',
string: 'SELECT MAX("post"."id") "max_id" FROM "post"'
},
params: []

@@ -286,2 +334,6 @@ });

},
oracle: {
text : 'SELECT MAX("post"."id") "max_id" FROM "post"',
string: 'SELECT MAX("post"."id") "max_id" FROM "post"'
},
params: []

@@ -308,2 +360,6 @@ });

},
oracle: {
text : 'SELECT SUM("post"."id") "id_sum" FROM "post"',
string: 'SELECT SUM("post"."id") "id_sum" FROM "post"'
},
params: []

@@ -330,2 +386,6 @@ });

},
oracle: {
text : 'SELECT SUM("post"."id") "sum_id" FROM "post"',
string: 'SELECT SUM("post"."id") "sum_id" FROM "post"'
},
params: []

@@ -352,2 +412,6 @@ });

},
oracle: {
text : 'SELECT SUM("post"."id") "sum_id" FROM "post"',
string: 'SELECT SUM("post"."id") "sum_id" FROM "post"'
},
params: []

@@ -374,2 +438,6 @@ });

},
oracle: {
text : 'SELECT AVG("post"."id") "id_avg" FROM "post"',
string: 'SELECT AVG("post"."id") "id_avg" FROM "post"'
},
params: []

@@ -396,2 +464,6 @@ });

},
oracle: {
text : 'SELECT AVG("post"."id") "avg_id" FROM "post"',
string: 'SELECT AVG("post"."id") "avg_id" FROM "post"'
},
params: []

@@ -418,3 +490,7 @@ });

},
oracle: {
text : 'SELECT AVG("post"."id") "avg_id" FROM "post"',
string: 'SELECT AVG("post"."id") "avg_id" FROM "post"'
},
params: []
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT ("customer"."name" IS NULL) "nameIsNull" FROM "customer"',
string: 'SELECT ("customer"."name" IS NULL) "nameIsNull" FROM "customer"'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT ("customer"."name" + "customer"."age") "nameAndAge" FROM "customer" WHERE (("customer"."age" > :1) AND ("customer"."age" < :2))',
string: 'SELECT ("customer"."name" + "customer"."age") "nameAndAge" FROM "customer" WHERE (("customer"."age" > 10) AND ("customer"."age" < 20))'
},
params: [10, 20]

@@ -68,3 +76,7 @@ });

},
oracle: {
text : 'SELECT ("customer"."age" BETWEEN :1 AND :2) "ageBetween" FROM "customer"',
string: 'SELECT ("customer"."age" BETWEEN 10 AND 20) "ageBetween" FROM "customer"'
},
params: [10, 20]
});

@@ -277,13 +277,17 @@ 'use strict';

pg: {
text : 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES user(id)',
string: 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES user(id)'
text : 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")',
string: 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")'
},
sqlite: {
text : 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES user(id)',
string: 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES user(id)'
text : 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")',
string: 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")'
},
mysql: {
text : 'ALTER TABLE `post` ADD COLUMN `userId` int REFERENCES user(id)',
string: 'ALTER TABLE `post` ADD COLUMN `userId` int REFERENCES user(id)'
text : 'ALTER TABLE `post` ADD COLUMN `userId` int REFERENCES `user`(`id`)',
string: 'ALTER TABLE `post` ADD COLUMN `userId` int REFERENCES `user`(`id`)'
},
oracle: {
text : 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")',
string: 'ALTER TABLE "post" ADD COLUMN "userId" int REFERENCES "user"("id")'
},
params: []

@@ -306,3 +310,7 @@ });

},
oracle: {
text : 'ALTER TABLE "post" ADD COLUMN "picture" varchar(100)',
string: 'ALTER TABLE "post" ADD COLUMN "picture" varchar(100)'
},
params: []
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT ("customer"."name" + "customer"."age") FROM "customer"',
string: 'SELECT ("customer"."name" + "customer"."age") FROM "customer"'
},
params: []

@@ -47,2 +51,6 @@ });

},
oracle: {
text : 'SELECT ("post"."content" + :1) FROM "post" WHERE ("post"."userId" IN (SELECT "customer"."id" FROM "customer"))',
string: 'SELECT ("post"."content" + \'!\') FROM "post" WHERE ("post"."userId" IN (SELECT "customer"."id" FROM "customer"))'
},
params: ['!']

@@ -69,3 +77,7 @@ });

},
oracle: {
text : 'SELECT (("post"."id" + :1) + "post"."content") FROM "post" WHERE ("post"."userId" NOT IN (SELECT "customer"."id" FROM "customer"))',
string: 'SELECT (("post"."id" + \': \') + "post"."content") FROM "post" WHERE ("post"."userId" NOT IN (SELECT "customer"."id" FROM "customer"))'
},
params: [': ']
});

@@ -26,2 +26,7 @@ 'use strict';

},
oracle: {
text : 'SELECT (CASE WHEN 1=1 THEN :1 WHEN 0=1 THEN :2 ELSE :3 END) FROM "customer"',
string: 'SELECT (CASE WHEN 1=1 THEN 0 WHEN 0=1 THEN 1 ELSE 2 END) FROM "customer"',
params: [0, 1, 2]
},
params: [true, 0, false, 1, 2]

@@ -50,2 +55,7 @@ });

},
oracle: {
text : 'SELECT ("customer"."age" + (CASE WHEN 1=1 THEN :1 WHEN 0=1 THEN :2 ELSE :3 END)) FROM "customer"',
string: 'SELECT ("customer"."age" + (CASE WHEN 1=1 THEN 0 WHEN 0=1 THEN 1 ELSE 2 END)) FROM "customer"',
params: [0, 1, 2]
},
params: [true, 0, false, 1, 2]

@@ -74,2 +84,7 @@ });

},
oracle: {
text : 'SELECT ((CASE WHEN 1=1 THEN :1 WHEN 0=1 THEN :2 ELSE :3 END) + :4) FROM "customer"',
string: 'SELECT ((CASE WHEN 1=1 THEN 0 WHEN 0=1 THEN 1 ELSE 2 END) + 3) FROM "customer"',
params: [0, 1, 2, 3]
},
params: [true, 0, false, 1, 2, 3]

@@ -98,2 +113,7 @@ });

},
oracle: {
text : 'SELECT (CASE WHEN 1=1 THEN :1 WHEN 0=1 THEN :2 ELSE ("customer"."age" BETWEEN :3 AND :4) END) FROM "customer"',
string: 'SELECT (CASE WHEN 1=1 THEN 0 WHEN 0=1 THEN 1 ELSE ("customer"."age" BETWEEN 10 AND 20) END) FROM "customer"',
params: [0, 1, 10, 20]
},
params: [true, 0, false, 1, 10, 20]

@@ -122,2 +142,7 @@ });

},
oracle: {
text : 'SELECT (CASE WHEN 1=1 THEN :1 WHEN 0=1 THEN :2 END) FROM "customer"',
string: 'SELECT (CASE WHEN 1=1 THEN 0 WHEN 0=1 THEN 1 END) FROM "customer"',
params: [0, 1]
},
params: [true, 0, false, 1]

@@ -145,2 +170,6 @@ });

},
oracle: {
text : 'SELECT (CASE WHEN ("customer"."age" IN (:1, :2, :3)) THEN :4 WHEN ("customer"."age" <= :5) THEN :6 ELSE :7 END) FROM "customer"',
string: 'SELECT (CASE WHEN ("customer"."age" IN (10, 20, 30)) THEN 0 WHEN ("customer"."age" <= 60) THEN 1 ELSE 2 END) FROM "customer"'
},
params: [10, 20, 30, 0, 60, 1, 2]

@@ -168,2 +197,6 @@ });

},
oracle: {
text : 'SELECT (CASE WHEN ("customer"."age" IN (:1, :2, :3)) THEN :4 WHEN ("customer"."age" <= :5) THEN :6 END) FROM "customer"',
string: 'SELECT (CASE WHEN ("customer"."age" IN (10, 20, 30)) THEN 0 WHEN ("customer"."age" <= 60) THEN 1 END) FROM "customer"'
},
params: [10, 20, 30, 0, 60, 1]

@@ -191,3 +224,7 @@ });

},
oracle: {
text : 'SELECT (CASE WHEN ("customer"."age" IN (:1, :2, :3)) THEN ("customer"."age" + :4) WHEN ("customer"."age" <= :5) THEN ("customer"."age" - :6) END) FROM "customer"',
string: 'SELECT (CASE WHEN ("customer"."age" IN (10, 20, 30)) THEN ("customer"."age" + 5) WHEN ("customer"."age" <= 60) THEN ("customer"."age" - 1) END) FROM "customer"'
},
params: [10, 20, 30, 5, 60, 1]
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT CAST("customer"."age" AS int) FROM "customer"',
string: 'SELECT CAST("customer"."age" AS int) FROM "customer"'
},
params: []

@@ -47,2 +51,6 @@ });

},
oracle: {
text : 'SELECT CAST("customer"."name" AS varchar(10)) FROM "customer"',
string: 'SELECT CAST("customer"."name" AS varchar(10)) FROM "customer"'
},
params: []

@@ -70,2 +78,6 @@ });

},
oracle: {
text : 'SELECT CAST(("customer"."name" + "customer"."age") AS varchar(15)) FROM "customer"',
string: 'SELECT CAST(("customer"."name" + "customer"."age") AS varchar(15)) FROM "customer"'
},
params: []

@@ -93,2 +105,6 @@ });

},
oracle: {
text : 'SELECT CAST(CAST("customer"."name" AS varchar(15)) AS varchar(10)) FROM "customer"',
string: 'SELECT CAST(CAST("customer"."name" AS varchar(15)) AS varchar(10)) FROM "customer"'
},
params: []

@@ -116,2 +132,6 @@ });

},
oracle: {
text : 'SELECT "customer"."name" FROM "customer" WHERE ((CAST("customer"."age" AS int) + :1) = :2)',
string: 'SELECT "customer"."name" FROM "customer" WHERE ((CAST("customer"."age" AS int) + 100) = 150)'
},
params: [100, 150]

@@ -139,3 +159,7 @@ });

},
oracle: {
text : 'SELECT CAST("customer"."age" AS int) "age_int" FROM "customer"',
string: 'SELECT CAST("customer"."age" AS int) "age_int" FROM "customer"'
},
params: []
});

@@ -26,2 +26,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId")',
string: 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId")'
},
params: []

@@ -51,2 +55,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = \'\')'
},
params: ['']

@@ -79,2 +87,6 @@ });

},
oracle: {
text : 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") WHERE ("user"."name" = :1)',
string: 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") WHERE ("user"."name" = \'\')'
},
params: ['']

@@ -104,3 +116,7 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = \'\')'
},
params: ['']
});

@@ -36,2 +36,6 @@ 'use strict';

},
oracle: {
text : 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))',
string: 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))'
},
params: []

@@ -58,2 +62,6 @@ });

},
oracle: {
text : 'BEGIN EXECUTE IMMEDIATE \'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))\'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -955 THEN RAISE; END IF; END;',
string: 'BEGIN EXECUTE IMMEDIATE \'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))\'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -955 THEN RAISE; END IF; END;'
},
params: []

@@ -87,2 +95,6 @@ });

string: 'CREATE TABLE [user] ([id] varchar(100))'
},
oracle: {
text : 'CREATE TABLE "user" ("id" varchar(100))',
string: 'CREATE TABLE "user" ("id" varchar(100))'
}

@@ -116,2 +128,6 @@ });

string: 'CREATE TABLE [user] ([id] varchar(100))'
},
oracle: {
text : 'CREATE TABLE "user" ("id" varchar(100))',
string: 'CREATE TABLE "user" ("id" varchar(100))'
}

@@ -146,2 +162,6 @@ });

string: 'CREATE TABLE [user] ([id] varchar(100))'
},
oracle: {
text : 'CREATE TABLE "user" ("id" varchar(100))',
string: 'CREATE TABLE "user" ("id" varchar(100))'
}

@@ -174,2 +194,6 @@ });

string: 'CREATE TABLE [user] ([id] int PRIMARY KEY)'
},
oracle: {
text : 'CREATE TABLE "user" ("id" int PRIMARY KEY)',
string: 'CREATE TABLE "user" ("id" int PRIMARY KEY)'
}

@@ -198,2 +222,6 @@ });

string: 'CREATE TABLE `user` (`id` int NOT NULL)'
},
oracle: {
text : 'CREATE TABLE "user" ("id" int NOT NULL)',
string: 'CREATE TABLE "user" ("id" int NOT NULL)'
}

@@ -223,2 +251,6 @@ });

string: 'CREATE TABLE `user` (`id` int PRIMARY KEY)'
},
oracle: {
text : 'CREATE TABLE "user" ("id" int PRIMARY KEY)',
string: 'CREATE TABLE "user" ("id" int PRIMARY KEY)'
}

@@ -240,13 +272,17 @@ });

pg: {
text : 'CREATE TABLE "post" ("userId" int REFERENCES user(id))',
string: 'CREATE TABLE "post" ("userId" int REFERENCES user(id))'
text : 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))',
string: 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))'
},
sqlite: {
text : 'CREATE TABLE "post" ("userId" int REFERENCES user(id))',
string: 'CREATE TABLE "post" ("userId" int REFERENCES user(id))'
text : 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))',
string: 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))'
},
mysql: {
text : 'CREATE TABLE `post` (`userId` int REFERENCES user(id))',
string: 'CREATE TABLE `post` (`userId` int REFERENCES user(id))'
text : 'CREATE TABLE `post` (`userId` int REFERENCES `user`(`id`))',
string: 'CREATE TABLE `post` (`userId` int REFERENCES `user`(`id`))'
},
oracle: {
text : 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))',
string: 'CREATE TABLE "post" ("userId" int REFERENCES "user"("id"))'
},
params: []

@@ -272,13 +308,17 @@ });

pg: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES user(id), "caption" varchar(100))',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES user(id), "caption" varchar(100))'
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))'
},
sqlite: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES user(id), "caption" varchar(100))',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES user(id), "caption" varchar(100))'
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))'
},
mysql: {
text : 'CREATE TABLE `picture` (`userId` int REFERENCES user(id), `caption` varchar(100))',
string: 'CREATE TABLE `picture` (`userId` int REFERENCES user(id), `caption` varchar(100))'
text : 'CREATE TABLE `picture` (`userId` int REFERENCES `user`(`id`), `caption` varchar(100))',
string: 'CREATE TABLE `picture` (`userId` int REFERENCES `user`(`id`), `caption` varchar(100))'
},
oracle: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id"), "caption" varchar(100))'
},
params: []

@@ -301,13 +341,17 @@ });

pg: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES user(id) ON DELETE CASCADE)',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES user(id) ON DELETE CASCADE)'
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)'
},
sqlite: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES user(id) ON DELETE CASCADE)',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES user(id) ON DELETE CASCADE)'
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)'
},
mysql: {
text : 'CREATE TABLE `picture` (`userId` int REFERENCES user(id) ON DELETE CASCADE)',
string: 'CREATE TABLE `picture` (`userId` int REFERENCES user(id) ON DELETE CASCADE)'
text : 'CREATE TABLE `picture` (`userId` int REFERENCES `user`(`id`) ON DELETE CASCADE)',
string: 'CREATE TABLE `picture` (`userId` int REFERENCES `user`(`id`) ON DELETE CASCADE)'
},
oracle: {
text : 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)',
string: 'CREATE TABLE "picture" ("userId" int REFERENCES "user"("id") ON DELETE CASCADE)'
},
params: []

@@ -337,2 +381,6 @@ });

},
oracle: {
text : 'references is not a object for column userId (REFERENCES statements within CREATE TABLE and ADD COLUMN statements require refrences to be expressed as an object)',
throws: true
},
params: []

@@ -393,2 +441,6 @@ });

},
oracle: {
text : 'CREATE TABLE "post" ("id" int)',
string: 'CREATE TABLE "post" ("id" int)'
},
params: []

@@ -395,0 +447,0 @@ });

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'DELETE FROM "post" WHERE ("post"."content" = :1)',
string: 'DELETE FROM "post" WHERE ("post"."content" = \'hello\'\'s world\')'
},
params: ["hello's world"]

@@ -80,2 +84,6 @@ });

},
oracle: {
text: 'DELETE "user" FROM "user" INNER JOIN "post" ON ("post"."userId" = "user"."id") WHERE ("post"."content" = :1)',
string: 'DELETE "user" FROM "user" INNER JOIN "post" ON ("post"."userId" = "user"."id") WHERE ("post"."content" = \'foo\')'
},
params: [ 'foo' ]

@@ -104,2 +112,6 @@ });

},
oracle: {
text : 'DELETE FROM "post" WHERE ("post"."content" = :1)',
string: 'DELETE FROM "post" WHERE ("post"."content" = \'\')'
},
params: ['']

@@ -128,2 +140,6 @@ });

},
oracle: {
text : 'DELETE FROM "post" WHERE ("post"."content" = :1)',
string: 'DELETE FROM "post" WHERE ("post"."content" = \'\')'
},
params: ['']

@@ -152,3 +168,7 @@ });

},
oracle: {
text : 'DELETE FROM "post" WHERE (("post"."content" = :1) OR ("post"."content" IS NULL))',
string: 'DELETE FROM "post" WHERE (("post"."content" = \'\') OR ("post"."content" IS NULL))'
},
params: ['']
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT DISTINCT("user"."id") FROM "user"',
string: 'SELECT DISTINCT("user"."id") FROM "user"'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT COUNT(DISTINCT("user"."id")) "count" FROM "user"',
string: 'SELECT COUNT(DISTINCT("user"."id")) "count" FROM "user"'
},
params: []

@@ -70,2 +78,6 @@ });

},
oracle: {
text : 'SELECT DISTINCT "user".* FROM "user"',
string: 'SELECT DISTINCT "user".* FROM "user"'
},
params: []

@@ -92,2 +104,6 @@ });

},
oracle: {
text : 'SELECT DISTINCT "user"."id" FROM "user"',
string: 'SELECT DISTINCT "user"."id" FROM "user"'
},
params: []

@@ -114,4 +130,8 @@ });

},
oracle: {
text : 'SELECT DISTINCT "user"."id", "user"."name" FROM "user"',
string: 'SELECT DISTINCT "user"."id", "user"."name" FROM "user"'
},
params: []
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'DROP TABLE "post"',
string: 'DROP TABLE "post"'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'BEGIN EXECUTE IMMEDIATE \'DROP TABLE "post"\'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END;',
string: 'BEGIN EXECUTE IMMEDIATE \'DROP TABLE "post"\'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END;'
},
params: []

@@ -64,2 +72,6 @@ });

},
oracle: {
text : 'DROP TABLE "post" CASCADE CONSTRAINTS',
string: 'DROP TABLE "post" CASCADE CONSTRAINTS'
},
params: []

@@ -82,3 +94,7 @@ });

},
oracle: {
text : 'Oracle do not support RESTRICT in DROP TABLE',
throws: true
},
params: []
});

@@ -24,2 +24,6 @@ 'use strict';

string: 'SELECT [user].* FROM [user] , [post]'
},
oracle: {
text : 'SELECT "user".* FROM "user" , "post"',
string: 'SELECT "user".* FROM "user" , "post"'
}

@@ -45,2 +49,6 @@ });

string: 'SELECT [user].*, [post].* FROM [user] , [post]'
},
oracle: {
text : 'SELECT "user".*, "post".* FROM "user" , "post"',
string: 'SELECT "user".*, "post".* FROM "user" , "post"'
}

@@ -62,2 +70,6 @@ });

string: 'SELECT `user`.* FROM `user` , `post`'
},
oracle: {
text : 'SELECT "user".* FROM "user" , "post"',
string: 'SELECT "user".* FROM "user" , "post"'
}

@@ -79,3 +91,7 @@ });

string: 'SELECT `user`.* FROM `user` , `post`'
},
oracle: {
text : 'SELECT "user".* FROM "user" , "post"',
string: 'SELECT "user".* FROM "user" , "post"'
}
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId"',
string: 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId"'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId", "post"."id"',
string: 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId", "post"."id"'
},
params: []

@@ -68,2 +76,6 @@ });

},
oracle: {
text : 'Oracle does not support array_agg.',
throws: true
},
params: []

@@ -90,2 +102,6 @@ });

},
oracle: {
text : 'Oracle does not support array_agg.',
throws: true
},
params: []

@@ -112,3 +128,7 @@ });

},
oracel: {
text : 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId", "post"."id"',
string: 'SELECT "post"."content" FROM "post" GROUP BY "post"."userId", "post"."id"'
},
params: []
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > :1)',
string: 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > 10)'
},
params: [10]

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > :1) AND ("post"."userId" < :2)',
string: 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > 10) AND ("post"."userId" < 100)'
},
params: [10, 100]

@@ -68,3 +76,7 @@ });

},
oracle: {
text : 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > :1) AND ("post"."userId" < :2)',
string: 'SELECT "post"."userId", COUNT("post"."content") "content_count" FROM "post" GROUP BY "post"."userId" HAVING ("post"."userId" > 10) AND ("post"."userId" < 100)'
},
params: [10, 100]
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE (1=0)',
string: 'SELECT "post".* FROM "post" WHERE (1=0)'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (:1))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (1))'
},
params: [1]

@@ -68,2 +76,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NULL)'
},
params: []

@@ -90,2 +102,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (:1, :2))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (1, 2))'
},
params: [1, 2]

@@ -112,2 +128,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NULL)'
},
params: []

@@ -134,2 +154,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (:1, :2) OR "post"."id" IS NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (1, 2) OR "post"."id" IS NULL)'
},
params: [1, 2]

@@ -156,3 +180,7 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (:1, :2) OR "post"."id" IS NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IN (1, 2) OR "post"."id" IS NULL)'
},
params: [1, 2]
});

@@ -20,2 +20,6 @@ 'use strict';

},
oracle: {
text : 'SELECT * FROM USER_INDEXES WHERE TABLE_NAME = \'post\'',
string: 'SELECT * FROM USER_INDEXES WHERE TABLE_NAME = \'post\''
},
params: []

@@ -38,2 +42,6 @@ });

},
oracle: {
text : 'CREATE UNIQUE INDEX "index_name" USING BTREE ON "post" ("id","userId") WITH PARSER foo',
string: 'CREATE UNIQUE INDEX "index_name" USING BTREE ON "post" ("id","userId") WITH PARSER foo'
},
params: []

@@ -90,2 +98,6 @@ });

},
oracle: {
text : 'CREATE INDEX "post_id_userId" ON "post" ("userId","id")',
string: 'CREATE INDEX "post_id_userId" ON "post" ("userId","id")'
},
params: []

@@ -108,2 +120,6 @@ });

},
oracle: {
text : 'CREATE INDEX "post_id_userId" ON "post" ("userId","id")',
string: 'CREATE INDEX "post_id_userId" ON "post" ("userId","id")'
},
params: []

@@ -125,2 +141,6 @@ });

throws: true
},
oracle: {
text : 'No columns defined!',
throws: true
}

@@ -143,2 +163,6 @@ });

},
oracle: {
text : 'DROP INDEX "index_name"',
string: 'DROP INDEX "index_name"'
},
params: []

@@ -161,3 +185,7 @@ });

},
oracle: {
text : 'DROP INDEX "post_id_userId"',
string: 'DROP INDEX "post_id_userId"'
},
params: []
});

@@ -21,2 +21,6 @@ 'use strict';

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (\'test\', 1)'
},
params: ['test', 1]

@@ -39,2 +43,10 @@ });

},
mssql: {
text : 'INSERT INTO [post] ([content]) VALUES (@1)',
string: 'INSERT INTO [post] ([content]) VALUES (\'whoah\')'
},
oracle: {
text : 'INSERT INTO "post" ("content") VALUES (:1)',
string: 'INSERT INTO "post" ("content") VALUES (\'whoah\')'
},
params: ['whoah']

@@ -60,2 +72,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (\'test\', 2)'
},
params: ['test', 2]

@@ -81,2 +97,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (LOWER(:1), :2)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (LOWER(\'TEST\'), 2)'
},
params: ['TEST', 2]

@@ -105,2 +125,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content") VALUES (:1), (:2)',
string: 'INSERT INTO "post" ("content") VALUES (\'whoah\'), (\'hey\')'
},
params: ['whoah', 'hey']

@@ -130,2 +154,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2), (:3, :4)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (\'whoah\', 1), (\'hey\', 2)'
},
params: ['whoah', 1, 'hey', 2]

@@ -160,2 +188,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2), (:3, :4)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (\'whoah\', 1), (\'hey\', 2)'
},
params: ['whoah', 1, 'hey', 2]

@@ -182,2 +214,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" DEFAULT VALUES',
string: 'INSERT INTO "post" DEFAULT VALUES'
},
params: []

@@ -201,2 +237,5 @@ });

},
oracle: {
throws: true
},
params: []

@@ -220,2 +259,5 @@ });

},
oracle: {
throws: true
},
params: []

@@ -239,2 +281,5 @@ });

},
oracle: {
throws: true
},
params: []

@@ -258,2 +303,5 @@ });

},
oracle: {
throws: true
},
params: []

@@ -277,2 +325,5 @@ });

},
oracle: {
throws: true
},
params: []

@@ -308,3 +359,8 @@ });

params: ['whoah', 1, 'hey']
}
},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2), (:3, DEFAULT)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (\'whoah\', 1), (\'hey\', DEFAULT)',
params: ['whoah', 1, 'hey']
},
});

@@ -338,2 +394,7 @@

params: [1, 2, 'hey']
},
oracle: {
text : 'INSERT INTO "post" ("userId", "content") VALUES (:1, DEFAULT), (:2, :3)',
string: 'INSERT INTO "post" ("userId", "content") VALUES (1, DEFAULT), (2, \'hey\')',
params: [1, 2, 'hey']
}

@@ -361,2 +422,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") SELECT \'test\', "user"."id" FROM "user" WHERE ("user"."name" LIKE :1)',
string: 'INSERT INTO "post" ("content", "userId") SELECT \'test\', "user"."id" FROM "user" WHERE ("user"."name" LIKE \'A%\')'
},
params: ['A%']

@@ -384,2 +449,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") SELECT \'test\', "user"."id" FROM "user" WHERE ("user"."name" LIKE :1)',
string: 'INSERT INTO "post" ("content", "userId") SELECT \'test\', "user"."id" FROM "user" WHERE ("user"."name" LIKE \'A%\')'
},
params: ['A%']

@@ -403,2 +472,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("userId") SELECT "user"."id" FROM "user" WHERE ("user"."name" LIKE :1)',
string: 'INSERT INTO "post" ("userId") SELECT "user"."id" FROM "user" WHERE ("user"."name" LIKE \'A%\')'
},
params: ['A%']

@@ -426,2 +499,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("userId") SELECT "post"."userId" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") WHERE ("post"."tags" LIKE :1)',
string: 'INSERT INTO "post" ("userId") SELECT "post"."userId" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") WHERE ("post"."tags" LIKE \'A%\')'
},
params: ['A%']

@@ -448,2 +525,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("userId") SELECT DISTINCT "user"."id" FROM "user"',
string: 'INSERT INTO "post" ("userId") SELECT DISTINCT "user"."id" FROM "user"'
},
params: []

@@ -471,2 +552,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (utl_raw.cast_to_varchar2(hextoraw(\'74657374\')), 2)'
},
params: [new Buffer('test'), 2]

@@ -496,2 +581,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content", "userId") VALUES (:1, :2)',
string: 'INSERT INTO "post" ("content", "userId") VALUES (utl_raw.cast_to_varchar2(hextoraw(\'74657374\')), 2)'
},
params: [new Buffer('test'), 2]

@@ -524,2 +613,6 @@ });

},
oracle: {
text : 'INSERT INTO "post" ("content") VALUES (:1), (:2)',
string: 'INSERT INTO "post" ("content") VALUES (utl_raw.cast_to_varchar2(hextoraw(\'77686f6168\'))), (utl_raw.cast_to_varchar2(hextoraw(\'686579\')))'
},
params: [new Buffer('whoah'), new Buffer('hey')]

@@ -548,2 +641,5 @@ });

},
oracle: {
throws: true
},
params: ['test', 2, 'testupdate']

@@ -550,0 +646,0 @@ });

@@ -26,2 +26,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId")',
string: 'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId")'
},
params: []

@@ -48,2 +52,6 @@ });

},
oracle: {
text : '"user" INNER JOIN "post" ON ("user"."id" = "post"."userId")',
string: '"user" INNER JOIN "post" ON ("user"."id" = "post"."userId")'
},
params: []

@@ -75,2 +83,6 @@ });

},
oracle: {
text : 'SELECT "user"."name", "post"."content", "comment"."text" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") INNER JOIN "comment" ON ("post"."id" = "comment"."postId")',
string: 'SELECT "user"."name", "post"."content", "comment"."text" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId") INNER JOIN "comment" ON ("post"."id" = "comment"."postId")'
},
params: []

@@ -97,2 +109,6 @@ });

},
oracle: {
text : 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId")',
string: 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId")'
},
params: []

@@ -124,2 +140,6 @@ });

},
oracle: {
text : 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId") LEFT JOIN "comment" ON ("post"."id" = "comment"."postId")',
string: 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId") LEFT JOIN "comment" ON ("post"."id" = "comment"."postId")'
},
params: []

@@ -156,3 +176,7 @@ });

},
oracle: {
text : 'SELECT "user"."name", "subposts"."content" FROM "user" INNER JOIN (SELECT "post"."content", "post"."userId" "subpostUserId" FROM "post") "subposts" ON ("user"."id" = "subposts"."subpostUserId")',
string: 'SELECT "user"."name", "subposts"."content" FROM "user" INNER JOIN (SELECT "post"."content", "post"."userId" "subpostUserId" FROM "post") "subposts" ON ("user"."id" = "subposts"."subpostUserId")'
},
params: []
});

@@ -57,2 +57,6 @@ 'use strict';

},
oracle: {
text : '"user" INNER JOIN "post" ON ("user"."id" = "post"."ownerId")',
string: '"user" INNER JOIN "post" ON ("user"."id" = "post"."ownerId")'
},
params: []

@@ -79,2 +83,6 @@ });

},
oracle: {
text : '"post" INNER JOIN "user" ON ("user"."id" = "post"."ownerId")',
string: '"post" INNER JOIN "user" ON ("user"."id" = "post"."ownerId")'
},
params: []

@@ -101,3 +109,7 @@ });

},
oracle: {
text : '"user" INNER JOIN "photo" ON ("user"."id" = "photo"."ownerId")',
string: '"user" INNER JOIN "photo" ON ("user"."id" = "photo"."ownerId")'
},
params: []
});

@@ -69,2 +69,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "user".* FROM "user" ORDER BY "user"."name" OFFSET 10 ROWS',
string: 'SELECT "user".* FROM "user" ORDER BY "user"."name" OFFSET 10 ROWS'
},
params: []

@@ -95,2 +99,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE ("user"."name" = :1) OFFSET (SELECT FLOOR(RANDOM() * COUNT(*)) FROM "user" WHERE ("user"."name" = :2)) ROWS FETCH NEXT 1 ROWS ONLY',
string: 'SELECT "user".* FROM "user" WHERE ("user"."name" = \'John\') OFFSET (SELECT FLOOR(RANDOM() * COUNT(*)) FROM "user" WHERE ("user"."name" = \'John\')) ROWS FETCH NEXT 1 ROWS ONLY'
},
values: ['John', 'John']

@@ -97,0 +105,0 @@ });

@@ -20,2 +20,6 @@ 'use strict';

},
oracle: {
text : 'SELECT foo, "user"."name", 123 "onetwothree" FROM "user"',
string: 'SELECT foo, "user"."name", 123 "onetwothree" FROM "user"'
},
params: []

@@ -39,2 +43,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE foo = bar',
string: 'SELECT "user".* FROM "user" WHERE foo = bar'
},
params: []

@@ -61,3 +69,7 @@ });

},
oracle: {
text : 'SELECT COUNT("subquery_for_count"."count_column") "count_column_count" FROM (SELECT 1 "count_column" FROM "user" OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY) "subquery_for_count"',
string: 'SELECT COUNT("subquery_for_count"."count_column") "count_column_count" FROM (SELECT 1 "count_column" FROM "user" OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY) "subquery_for_count"'
},
params: []
});

@@ -33,2 +33,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE (INSTR ("post"."content", :1) > 0)',
string: 'SELECT "post".* FROM "post" WHERE (INSTR ("post"."content", \'hello\') > 0)'
},
params: ['hello']

@@ -35,0 +39,0 @@ });

@@ -27,2 +27,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "u"."name" FROM "user" "u"',
string: 'SELECT "u"."name" FROM "user" "u"'
},
params: []

@@ -49,2 +53,6 @@ });

},
oracle: {
text : 'SELECT "u".* FROM "user" "u"',
string: 'SELECT "u".* FROM "user" "u"'
},
params: []

@@ -72,2 +80,6 @@ });

},
oracle: {
text : 'SELECT "u"."name" FROM "user" "u" INNER JOIN "post" "p" ON (("u"."id" = "p"."userId") AND ("p"."id" = :1))',
string: 'SELECT "u"."name" FROM "user" "u" INNER JOIN "post" "p" ON (("u"."id" = "p"."userId") AND ("p"."id" = 3))'
},
params: [3]

@@ -94,2 +106,6 @@ });

},
oracle: {
text : 'SELECT "p"."content", "u"."name" FROM "user" "u" INNER JOIN "post" "p" ON (("u"."id" = "p"."userId") AND ("p"."content" IS NOT NULL))',
string: 'SELECT "p"."content", "u"."name" FROM "user" "u" INNER JOIN "post" "p" ON (("u"."id" = "p"."userId") AND ("p"."content" IS NOT NULL))'
},
params: []

@@ -129,3 +145,7 @@ });

},
orcle: {
text : 'SELECT "comment"."text", "comment"."userId" FROM "comment"',
string: 'SELECT "comment"."text", "comment"."userId" FROM "comment"'
},
params: []
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE (1=1)',
string: 'SELECT "post".* FROM "post" WHERE (1=1)'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" NOT IN (:1))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" NOT IN (1))'
},
params: [1]

@@ -68,2 +76,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NOT NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NOT NULL)'
},
params: []

@@ -90,2 +102,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" NOT IN (:1, :2))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" NOT IN (1, 2))'
},
params: [1, 2]

@@ -112,2 +128,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NOT NULL)',
string: 'SELECT "post".* FROM "post" WHERE ("post"."id" IS NOT NULL)'
},
params: []

@@ -134,2 +154,6 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE (NOT ("post"."id" IN (:1, :2) OR "post"."id" IS NULL))',
string: 'SELECT "post".* FROM "post" WHERE (NOT ("post"."id" IN (1, 2) OR "post"."id" IS NULL))'
},
params: [1, 2]

@@ -156,3 +180,7 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE (NOT ("post"."id" IN (:1, :2) OR "post"."id" IS NULL))',
string: 'SELECT "post".* FROM "post" WHERE (NOT ("post"."id" IN (1, 2) OR "post"."id" IS NULL))'
},
params: [1, 2]
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post"."content" FROM "post" ORDER BY "post"."content"',
string: 'SELECT "post"."content" FROM "post" ORDER BY "post"."content"'
},
params: []

@@ -47,2 +51,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC',
string: 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC'
},
params: []

@@ -69,2 +77,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC',
string: 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC'
},
params: []

@@ -91,2 +103,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC',
string: 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC'
},
params: []

@@ -113,2 +129,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC',
string: 'SELECT "post"."content" FROM "post" ORDER BY "post"."content", "post"."userId" DESC'
},
params: []

@@ -135,2 +155,6 @@ });

},
oracle: {
text : 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL)',
string: 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL)'
},
params: []

@@ -157,2 +181,6 @@ });

},
oracle: {
text : 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL) DESC',
string: 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL) DESC'
},
params: []

@@ -179,2 +207,6 @@ });

},
oracle: {
text : 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL)',
string: 'SELECT ("post"."content" IS NULL) FROM "post" ORDER BY ("post"."content" IS NULL)'
},
params: []

@@ -201,2 +233,6 @@ });

},
oracle: {
text : 'SELECT RTRIM("post"."content") FROM "post" ORDER BY RTRIM("post"."content")',
string: 'SELECT RTRIM("post"."content") FROM "post" ORDER BY RTRIM("post"."content")'
},
params: []

@@ -223,3 +259,7 @@ });

},
oracle: {
text : 'SELECT RTRIM("post"."content") FROM "post" ORDER BY RTRIM("post"."content") DESC',
string: 'SELECT RTRIM("post"."content") FROM "post" ORDER BY RTRIM("post"."content") DESC'
},
params: []
});

@@ -31,2 +31,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "staging"."user"."id" FROM "staging"."user"',
string: 'SELECT "staging"."user"."id" FROM "staging"."user"'
},
params: []

@@ -53,2 +57,6 @@ });

},
oracle: {
text : 'SELECT COUNT("staging"."user"."id") "id_count" FROM "staging"."user"',
string: 'SELECT COUNT("staging"."user"."id") "id_count" FROM "staging"."user"'
},
params: []

@@ -75,2 +83,6 @@ });

},
oracle: {
text : 'SELECT "staging"."user"."id", "staging"."user"."name" FROM "staging"."user"',
string: 'SELECT "staging"."user"."id", "staging"."user"."name" FROM "staging"."user"'
},
params: []

@@ -98,2 +110,6 @@ });

},
oracle: {
text : 'SELECT "uws"."name" FROM "staging"."user" "uws"',
string: 'SELECT "uws"."name" FROM "staging"."user" "uws"'
},
params: []

@@ -126,2 +142,6 @@ });

},
oracle: {
text : 'SELECT "staging"."user"."name", "dev"."post"."content" FROM "staging"."user" INNER JOIN "dev"."post" ON ("staging"."user"."id" = "dev"."post"."userId")',
string: 'SELECT "staging"."user"."name", "dev"."post"."content" FROM "staging"."user" INNER JOIN "dev"."post" ON ("staging"."user"."id" = "dev"."post"."userId")'
},
params: []

@@ -148,3 +168,7 @@ });

},
oracle: {
text : 'SELECT "uws"."name", "dev"."post"."content" FROM "staging"."user" "uws" INNER JOIN "dev"."post" ON ("uws"."id" = "dev"."post"."userId")',
string: 'SELECT "uws"."name", "dev"."post"."content" FROM "staging"."user" "uws" INNER JOIN "dev"."post" ON ("uws"."id" = "dev"."post"."userId")'
},
params: []
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "post"."id", "post"."content" FROM "post"',
string: 'SELECT "post"."id", "post"."content" FROM "post"'
},
params: []

@@ -43,3 +47,11 @@ });

},
mssql: {
text : 'SELECT [customer].[id] AS [id_alias], [customer].[name] AS [name_alias], [customer].[age] AS [age_alias], [customer].[income] AS [income_alias], [customer].[metadata] AS [metadata_alias] FROM [customer]',
string: 'SELECT [customer].[id] AS [id_alias], [customer].[name] AS [name_alias], [customer].[age] AS [age_alias], [customer].[income] AS [income_alias], [customer].[metadata] AS [metadata_alias] FROM [customer]'
},
oracle: {
text : 'SELECT "customer"."id" "id_alias", "customer"."name" "name_alias", "customer"."age" "age_alias", "customer"."income" "income_alias", "customer"."metadata" "metadata_alias" FROM "customer"',
string: 'SELECT "customer"."id" "id_alias", "customer"."name" "name_alias", "customer"."age" "age_alias", "customer"."income" "income_alias", "customer"."metadata" "metadata_alias" FROM "customer"'
},
params: []
});

@@ -26,2 +26,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "user".* FROM "user"',
string: 'SELECT "user".* FROM "user"'
},
params: []

@@ -48,2 +52,6 @@ });

},
oracle: {
text : 'SELECT * FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT * FROM "user" WHERE ("user"."name" = 3)'
},
params: [3]

@@ -70,2 +78,6 @@ });

},
oracle: {
text : 'SELECT * FROM "user" WHERE (("user"."name" = :1) AND ("user"."id" = :2))',
string: 'SELECT * FROM "user" WHERE (("user"."name" = 3) AND ("user"."id" = 1))'
},
params: [3, 1]

@@ -93,2 +105,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post"',
string: 'SELECT "post"."content" FROM "post"'
},
params: []

@@ -115,2 +131,6 @@ });

},
oracle: {
text : 'SELECT "post"."content" FROM "post" WHERE ("post"."userId" = :1)',
string: 'SELECT "post"."content" FROM "post" WHERE ("post"."userId" = 1)'
},
params: [1]

@@ -141,3 +161,7 @@ });

},
oracle: {
text : 'SELECT * FROM "post" WHERE ((("post"."content" IS NULL) OR ("post"."content" = :1)) AND ("post"."userId" = :2))',
string: 'SELECT * FROM "post" WHERE ((("post"."content" IS NULL) OR ("post"."content" = \'\')) AND ("post"."userId" = 1))'
},
params: ['', 1]
});

@@ -30,2 +30,6 @@ 'use strict';

},
oracle: {
text : '("user"."name" IN (SELECT "customer"."name" FROM "customer" WHERE ("user"."name" IN (SELECT "customer"."name" FROM "customer" WHERE ("user"."name" LIKE :1)))))',
string: '("user"."name" IN (SELECT "customer"."name" FROM "customer" WHERE ("user"."name" IN (SELECT "customer"."name" FROM "customer" WHERE ("user"."name" LIKE \'%HELLO%\')))))'
},
params: ['%HELLO%']

@@ -52,2 +56,6 @@ });

},
oracle: {
text : 'SELECT * FROM (SELECT * FROM "user")',
string: 'SELECT * FROM (SELECT * FROM "user")'
},
params: []

@@ -74,2 +82,6 @@ });

},
oracle: {
text : 'SELECT * FROM (SELECT * FROM "customer") "T1" , (SELECT * FROM "user") "T2"',
string: 'SELECT * FROM (SELECT * FROM "customer") "T1" , (SELECT * FROM "user") "T2"'
},
params: []

@@ -99,2 +111,6 @@ });

},
oracle: {
text : '("customer"."name" BETWEEN (SELECT MIN("customer"."name") FROM "customer") AND (SELECT MAX("customer"."name") FROM "customer"))',
string: '("customer"."name" BETWEEN (SELECT MIN("customer"."name") FROM "customer") AND (SELECT MAX("customer"."name") FROM "customer"))'
},
params: []

@@ -121,3 +137,7 @@ });

},
oracle: {
text : '(EXISTS (SELECT * FROM "user" WHERE ("user"."name" = "customer"."name")))',
string: '(EXISTS (SELECT * FROM "user" WHERE ("user"."name" = "customer"."name")))'
},
params: []
});

@@ -11,3 +11,4 @@ 'use strict';

mysql : require('../../lib/dialect/mysql'),
mssql : require('../../lib/dialect/mssql')
mssql : require('../../lib/dialect/mssql'),
oracle : require('../../lib/dialect/oracle')
};

@@ -14,0 +15,0 @@

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "user"."id" FROM "user"',
string: 'SELECT "user"."id" FROM "user"'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT "user"."id", "user"."name" FROM "user"',
string: 'SELECT "user"."id", "user"."name" FROM "user"'
},
params: []

@@ -68,2 +76,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user"',
string: 'SELECT "user".* FROM "user"'
},
params: []

@@ -86,2 +98,6 @@ });

},
oracle: {
text: 'SELECT "user"."id", "user"."name" FROM "user"',
string: 'SELECT "user"."id", "user"."name" FROM "user"'
},
params: []

@@ -104,2 +120,6 @@ });

},
oracle: {
text: 'SELECT "user"."id", "user"."name" FROM "user"',
string: 'SELECT "user"."id", "user"."name" FROM "user"'
},
params: []

@@ -122,2 +142,6 @@ });

},
oracle: {
text: 'SELECT "user"."id", "user"."name" FROM "user"',
string: 'SELECT "user"."id", "user"."name" FROM "user"'
},
params: []

@@ -140,2 +164,6 @@ });

},
oracle: {
text: 'SELECT "user".*, "user"."id" "foo_id", "user"."name" "foo_name", "user"."id" "bar_id", "user"."name" "bar_name" FROM "user"',
string: 'SELECT "user".*, "user"."id" "foo_id", "user"."name" "foo_name", "user"."id" "bar_id", "user"."name" "bar_name" FROM "user"'
},
params: []

@@ -162,2 +190,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT "user"."id" FROM "user" WHERE ("user"."name" = \'foo\')'
},
params: ['foo']

@@ -184,2 +216,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = :1) OR ("user"."name" = :2))',
string: 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = \'foo\') OR ("user"."name" = \'bar\'))'
},
params: ['foo', 'bar']

@@ -206,2 +242,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = :1) AND ("user"."name" = :2))',
string: 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = \'foo\') AND ("user"."name" = \'bar\'))'
},
params: ['foo', 'bar']

@@ -228,2 +268,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = :1) OR ("user"."name" = :2))',
string: 'SELECT "user"."id" FROM "user" WHERE (("user"."name" = \'foo\') OR ("user"."name" = \'bar\'))'
},
params: ['foo', 'bar']

@@ -250,2 +294,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ((("user"."name" = :1) OR ("user"."name" = :2)) AND ("user"."name" = :3))',
string: 'SELECT "user"."id" FROM "user" WHERE ((("user"."name" = \'foo\') OR ("user"."name" = \'baz\')) AND ("user"."name" = \'bar\'))'
},
params: ['foo', 'baz', 'bar']

@@ -272,2 +320,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ("user"."name" IN (:1, :2))',
string: 'SELECT "user"."id" FROM "user" WHERE ("user"."name" IN (\'foo\', \'bar\'))'
},
params: ['foo', 'bar']

@@ -294,2 +346,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE (("user"."name" IN (:1, :2)) AND ("user"."id" = :3))',
string: 'SELECT "user"."id" FROM "user" WHERE (("user"."name" IN (\'foo\', \'bar\')) AND ("user"."id" = 1))'
},
params: ['foo', 'bar', 1]

@@ -316,2 +372,6 @@ });

},
oracle: {
text : 'SELECT "user"."id", "user"."name" FROM "user"',
string: 'SELECT "user"."id", "user"."name" FROM "user"'
},
params: []

@@ -345,2 +405,6 @@ });

},
oracle: {
text : 'SELECT "user"."id" FROM "user" WHERE ((("user"."name" = :1) AND ("user"."id" = :2)) OR (("user"."name" = :3) AND ("user"."id" = :4)))',
string: 'SELECT "user"."id" FROM "user" WHERE ((("user"."name" = \'boom\') AND ("user"."id" = 1)) OR (("user"."name" = \'bang\') AND ("user"."id" = 2)))'
},
params: ['boom', 1, 'bang', 2]

@@ -367,2 +431,6 @@ });

},
oracle: {
text : 'SELECT "user"."name" "user name", "user"."id" "user id" FROM "user"',
string: 'SELECT "user"."name" "user name", "user"."id" "user id" FROM "user"'
},
params: []

@@ -385,6 +453,10 @@ });

},
sqlsever: {
mssql: {
text : 'SELECT [user].[name] AS [user name] FROM [user] WHERE ([user].[name] = @1)',
string: 'SELECT [user].[name] AS [user name] FROM [user] WHERE ([user].[name] = \'brian\')'
},
oracle: {
text : 'SELECT "user"."name" "user name" FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT "user"."name" "user name" FROM "user" WHERE ("user"."name" = \'brian\')'
},
params: ['brian']

@@ -411,2 +483,6 @@ });

},
oracle: {
text : 'SELECT "user"."name" FROM "user" WHERE ("user"."name" = :1)',
string: 'SELECT "user"."name" FROM "user" WHERE ("user"."name" = \'brian\')'
},
params: ['brian']

@@ -433,2 +509,6 @@ });

},
oracle: {
text : 'SELECT name FROM user WHERE (name <> NULL)',
string: 'SELECT name FROM user WHERE (name <> NULL)'
},
params: []

@@ -455,2 +535,6 @@ });

},
oracle: {
text : 'SELECT name,id FROM user WHERE (name <> NULL)',
string: 'SELECT name,id FROM user WHERE (name <> NULL)'
},
params: []

@@ -477,2 +561,6 @@ });

},
oracle: {
text : 'SELECT name, id FROM user WHERE (name <> NULL)',
string: 'SELECT name, id FROM user WHERE (name <> NULL)'
},
params: []

@@ -499,2 +587,6 @@ });

},
oracle: {
text : 'SELECT name, id FROM user WHERE ((name <> NULL) AND (id <> NULL))',
string: 'SELECT name, id FROM user WHERE ((name <> NULL) AND (id <> NULL))'
},
params: []

@@ -523,2 +615,6 @@ });

},
oracle: {
text : 'SELECT name FROM user WHERE ("user"."name" = :1)',
string: 'SELECT name FROM user WHERE ("user"."name" = \'brian\')'
},
params: ['brian']

@@ -548,2 +644,6 @@ });

},
oracle: {
text : 'SELECT name FROM user WHERE (("user"."name" = :1) AND ("user"."id" = :2))',
string: 'SELECT name FROM user WHERE (("user"."name" = \'brian\') AND ("user"."id" = 1))'
},
params: ['brian', 1]

@@ -570,2 +670,6 @@ });

},
oracle: {
text : 'SELECT "user"."name" "quote""quote""tick`tick`" FROM "user"',
string: 'SELECT "user"."name" "quote""quote""tick`tick`" FROM "user"'
},
params: []

@@ -592,3 +696,7 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE ("user"."id" IN (SELECT "user"."id" FROM "user"))',
string: 'SELECT "user".* FROM "user" WHERE ("user"."id" IN (SELECT "user"."id" FROM "user"))'
},
params: []
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "customer".* FROM "customer" WHERE ("customer"."age" BETWEEN :1 AND :2)',
string: 'SELECT "customer".* FROM "customer" WHERE ("customer"."age" BETWEEN 18 AND 25)'
},
params: [18, 25]

@@ -47,3 +51,7 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."userId" BETWEEN (SELECT MIN("customer"."id") "id_min" FROM "customer") AND (SELECT MAX("customer"."id") "id_max" FROM "customer"))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."userId" BETWEEN (SELECT MIN("customer"."id") "id_min" FROM "customer") AND (SELECT MAX("customer"."id") "id_max" FROM "customer"))'
},
params: []
});

@@ -26,2 +26,6 @@ 'use strict';

},
oracle: {
text : '("post"."content" = :1)',
string: '("post"."content" = NULL)'
},
params: [null]

@@ -49,2 +53,6 @@ });

},
oracle: {
text : '("post"."content" = :1)',
string: '("post"."content" = 3.14)'
},
params: [3.14]

@@ -72,2 +80,6 @@ });

},
oracle: {
text : '("post"."content" = :1)',
string: '("post"."content" = \'hello\'\'\')'
},
params: ['hello\'']

@@ -95,2 +107,6 @@ });

},
oracle: {
text : 'SQL Server does not support arrays.',
throws: true
},
params: [1, '2', null]

@@ -118,2 +134,6 @@ });

},
oracle: {
text : '("post"."content" = :1)',
string: '("post"."content" = \'2000-01-01T00:00:00.000Z\')'
},
params: [new Date('Sat, 01 Jan 2000 00:00:00 GMT')]

@@ -147,2 +167,6 @@ });

},
oracle: {
text : '("post"."content" = :1)',
string: '("post"."content" = \'secretMessage\')'
},
params: [customObject]

@@ -149,0 +173,0 @@ });

@@ -24,3 +24,7 @@ 'use strict';

},
oracle: {
text : 'TRUNCATE TABLE "post"',
string: 'TRUNCATE TABLE "post"'
},
params: []
});

@@ -25,2 +25,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "customer".* FROM "customer" WHERE ("customer"."age" IS NOT NULL)',
string: 'SELECT "customer".* FROM "customer" WHERE ("customer"."age" IS NOT NULL)'
},
params: []

@@ -47,3 +51,7 @@ });

},
oracle: {
text : 'SELECT "post".* FROM "post" WHERE ("post"."userId" IN (SELECT "customer"."id" FROM "customer" WHERE ("customer"."age" IS NULL)))',
string: 'SELECT "post".* FROM "post" WHERE ("post"."userId" IN (SELECT "customer"."id" FROM "customer" WHERE ("customer"."age" IS NULL)))'
},
params: []
});

@@ -27,2 +27,6 @@ 'use strict';

},
oracle: {
text : 'UPDATE "post" SET "content" = :1',
string: 'UPDATE "post" SET "content" = \'test\''
},
params: ['test']

@@ -52,2 +56,6 @@ });

},
oracle: {
text : 'UPDATE "post" SET "content" = :1, "userId" = :2',
string: 'UPDATE "post" SET "content" = \'test\', "userId" = 3'
},
params: ['test', 3]

@@ -77,2 +85,6 @@ });

},
oracle: {
text : 'UPDATE "post" SET "content" = :1, "userId" = :2',
string: 'UPDATE "post" SET "content" = NULL, "userId" = 3'
},
params: [null, 3]

@@ -102,2 +114,6 @@ });

},
oracle: {
text : 'UPDATE "post" SET "content" = :1, "userId" = :2 WHERE ("post"."content" = :3)',
string: 'UPDATE "post" SET "content" = \'test\', "userId" = 3 WHERE ("post"."content" = \'no\')'
},
params: ['test', 3, 'no']

@@ -126,2 +142,6 @@ });

},
oracle: {
text : 'UPDATE "post" SET "content" = "user"."name" FROM "user" WHERE ("post"."userId" = "user"."id")',
string: 'UPDATE "post" SET "content" = "user"."name" FROM "user" WHERE ("post"."userId" = "user"."id")'
},
params: []

@@ -151,2 +171,6 @@ });

},
oracle: {
text : 'UPDATE "post" SET "userId" = "user"."id" FROM "user" WHERE ("post"."userId" = "user"."id")',
string: 'UPDATE "post" SET "userId" = "user"."id" FROM "user" WHERE ("post"."userId" = "user"."id")'
},
params: []

@@ -172,3 +196,7 @@ });

},
oracle: {
text : 'UPDATE "post" SET "content" = :1',
string: 'UPDATE "post" SET "content" = utl_raw.cast_to_varchar2(hextoraw(\'74657374\'))'
},
params: [new Buffer('test')]
});

@@ -27,2 +27,6 @@ 'use strict';

},
oracle: {
text : 'SELECT "customer"."name", ("customer"."income" % :1) FROM "customer" WHERE ((("customer"."age" + :2) * ("customer"."age" - :3)) = :4)',
string: 'SELECT "customer"."name", ("customer"."income" % 100) FROM "customer" WHERE ((("customer"."age" + 5) * ("customer"."age" - 2)) = 10)'
},
params: [100, 5, 2, 10]

@@ -50,2 +54,6 @@ });

},
oracle: {
text : 'SELECT "customer"."name" FROM "customer" WHERE ("customer"."name" LIKE ("customer"."id" + :1))',
string: 'SELECT "customer"."name" FROM "customer" WHERE ("customer"."name" LIKE ("customer"."id" + \'hello\'))'
},
params: ['hello']

@@ -74,2 +82,6 @@ });

},
oracle: {
text : 'SELECT (((("variable"."a" * "variable"."a") / :1) + ("variable"."v" * "variable"."t")) = "variable"."d") FROM "variable"',
string: 'SELECT (((("variable"."a" * "variable"."a") / 2) + ("variable"."v" * "variable"."t")) = "variable"."d") FROM "variable"'
},
params: [2]

@@ -97,2 +109,6 @@ });

},
oracle: {
text : 'SELECT ((("variable"."a" * "variable"."a") + ("variable"."b" * "variable"."b")) = ("variable"."c" * "variable"."c")) FROM "variable"',
string: 'SELECT ((("variable"."a" * "variable"."a") + ("variable"."b" * "variable"."b")) = ("variable"."c" * "variable"."c")) FROM "variable"'
},
params: []

@@ -115,4 +131,8 @@ });

},
oracle: {
text : 'SELECT "post"."id" FROM "post" WHERE ("post"."content" = :1)',
string: 'SELECT "post"."id" FROM "post" WHERE ("post"."content" = utl_raw.cast_to_varchar2(hextoraw(\'74657374\')))',
},
params: [new Buffer('test')]
});

@@ -24,2 +24,6 @@ 'use strict';

},
oracle: {
text : 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))',
string: 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))'
},
params: []

@@ -46,2 +50,6 @@ });

},
oracle: {
text : 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))',
string: 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))'
},
params: []

@@ -68,2 +76,6 @@ });

},
oracle: {
text : 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))',
string: 'SELECT * FROM "user" WHERE (("user"."id" IS NOT NULL) AND ("user"."name" IS NOT NULL))'
},
params: []

@@ -90,2 +102,6 @@ });

},
oracle: {
text : 'SELECT * FROM "user" WHERE (1 = 1)',
string: 'SELECT * FROM "user" WHERE (1 = 1)'
},
params: []

@@ -112,2 +128,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE (("user"."id" = :1) AND ("user"."name" = :2))',
string: 'SELECT "user".* FROM "user" WHERE (("user"."id" = 1) AND ("user"."name" = \'a\'))'
},
params: [1,'a']

@@ -134,2 +154,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE ("user"."id" = :1)',
string: 'SELECT "user".* FROM "user" WHERE ("user"."id" = 1)'
},
params: [1]

@@ -156,2 +180,6 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE ("user"."id" = :1)',
string: 'SELECT "user".* FROM "user" WHERE ("user"."id" = 1)'
},
params: [1]

@@ -178,4 +206,8 @@ });

},
oracle: {
text : 'SELECT "user".* FROM "user" WHERE (("user"."id" = :1) OR ("user"."name" = :2))',
string: 'SELECT "user".* FROM "user" WHERE (("user"."id" = 1) OR ("user"."name" = \'a\'))'
},
params: [1,'a']
});

@@ -33,3 +33,8 @@ 'use strict';

});
test('stores the oracle dialect', function() {
assert.equal(sql.create('oracle').dialectName, 'oracle');
});
test('can create a query using the default dialect', function() {

@@ -60,2 +65,3 @@ var query = sql.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toQuery();

var sqlite = sql.create('sqlite');
var oracle = sql.create('oracle');

@@ -66,2 +72,3 @@ var mssqlTable = mssql.define({name: 'table', columns: ['column']});

var sqliteTable = sqlite.define({name: 'table', columns: ['column']});
var oracleTable = oracle.define({name: 'table', columns: ['column']});

@@ -72,2 +79,3 @@ assert.equal(mysqlTable.sql, mysql);

assert.equal(mssqlTable.sql, mssql);
assert.equal(oracleTable.sql, oracle);
});

@@ -81,2 +89,3 @@

var sqlite = new Sql('sqlite');
var oracle = new Sql('oracle');

@@ -87,2 +96,3 @@ assert.equal(mysql.dialect, require(__dirname + '/../lib/dialect/mysql'));

assert.equal(mssql.dialect, require(__dirname + '/../lib/dialect/mssql'));
assert.equal(oracle.dialect, require(__dirname + '/../lib/dialect/oracle'));
});

@@ -96,2 +106,3 @@

var sqlite = new Sql('sqlite');
var oracle = new Sql('oracle');

@@ -102,2 +113,3 @@ var sqliteQuery = mysql.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toQuery('sqlite');

var mssqlQuery = mysql.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toQuery('mssql');
var oracleQuery = oracle.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toQuery('oracle');

@@ -116,2 +128,5 @@ var values = ['brian.m.carlson@gmail.com'];

assert.deepEqual(mssqlQuery.values, values);
assert.equal(oracleQuery.text, 'SELECT "user"."id" FROM "user" WHERE ("user"."email" = :1)');
assert.deepEqual(oracleQuery.values, values);
});

@@ -152,2 +167,4 @@

var sqlite = new Sql('sqlite');
var mssql = new Sql('mssql');
var oracle = new Sql('oracle');

@@ -157,3 +174,6 @@ var sqliteQuery = mysql.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toNamedQuery('user.select_brian','sqlite');

var mysqlQuery = postgres.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toNamedQuery('user.select_brian','mysql');
var oracleQuery = mssql.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toNamedQuery('user.select_brian','oracle');
var mssqlQuery = oracle.select(user.id).from(user).where(user.email.equals('brian.m.carlson@gmail.com')).toNamedQuery('user.select_brian','mssql');
var values = ['brian.m.carlson@gmail.com'];

@@ -171,2 +191,10 @@ assert.equal(sqliteQuery.text, 'SELECT "user"."id" FROM "user" WHERE ("user"."email" = $1)');

assert.equal('user.select_brian', mysqlQuery.name);
assert.equal(mssqlQuery.text, 'SELECT [user].[id] FROM [user] WHERE ([user].[email] = @1)');
assert.deepEqual(mssqlQuery.values, values);
assert.equal('user.select_brian', mssqlQuery.name);
assert.equal(oracleQuery.text, 'SELECT "user"."id" FROM "user" WHERE ("user"."email" = :1)');
assert.deepEqual(oracleQuery.values, values);
assert.equal('user.select_brian', oracleQuery.name);

@@ -173,0 +201,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc