Start of mssql driver
This commit is contained in:
parent
c034604c94
commit
2e661e24ff
@ -13,7 +13,9 @@ const dbDriverMap = new Map([
|
|||||||
['postgres', 'Pg'],
|
['postgres', 'Pg'],
|
||||||
['pg', 'Pg'],
|
['pg', 'Pg'],
|
||||||
['sqlite3', 'Sqlite'],
|
['sqlite3', 'Sqlite'],
|
||||||
['sqlite', 'Sqlite']
|
['sqlite', 'Sqlite'],
|
||||||
|
['sqlserver', 'MSSQLServer'],
|
||||||
|
['mssql', 'MSSQLServer']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,7 +45,7 @@ class NodeQuery {
|
|||||||
constructor (config) {
|
constructor (config) {
|
||||||
this.instance = null;
|
this.instance = null;
|
||||||
|
|
||||||
if (config != null) {
|
if (config !== undefined) {
|
||||||
let drivername = dbDriverMap.get(config.driver);
|
let drivername = dbDriverMap.get(config.driver);
|
||||||
|
|
||||||
if (!drivername) {
|
if (!drivername) {
|
||||||
@ -55,6 +57,8 @@ class NodeQuery {
|
|||||||
|
|
||||||
let adapter = new Adapter(config.connection);
|
let adapter = new Adapter(config.connection);
|
||||||
this.instance = new QueryBuilder(driver, adapter);
|
this.instance = new QueryBuilder(driver, adapter);
|
||||||
|
} else {
|
||||||
|
throw new Error('What am I supposed to do without any config options, guess?');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
test/sql/mssql.sql
Normal file
15
test/sql/mssql.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
DROP TABLE IF EXISTS [create_join];
|
||||||
|
DROP TABLE IF EXISTS [create_test];
|
||||||
|
|
||||||
|
-- Table create_join
|
||||||
|
CREATE TABLE [create_join] (
|
||||||
|
[id] INTEGER,
|
||||||
|
[key] VARCHAR(255),
|
||||||
|
[val] NVARCHAR(2048)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE [create_test] (
|
||||||
|
[id] INTEGER,
|
||||||
|
[key] VARCHAR(255),
|
||||||
|
[val] NVARCHAR(2048)
|
||||||
|
);
|
Loading…
Reference in New Issue
Block a user