不要怂,就是干,撸起袖子干!

Commit b8056412 by Ruben Bridgewater

Fix some data types in mssql and postgres

1 parent 073f1777
...@@ -18,6 +18,18 @@ STRING.prototype.toSql = function() { ...@@ -18,6 +18,18 @@ STRING.prototype.toSql = function() {
} }
}; };
var TEXT = function() {
if (!(this instanceof TEXT)) return new TEXT();
BaseTypes.TEXT.apply(this, arguments);
};
util.inherits(TEXT, BaseTypes.TEXT);
TEXT.prototype.toSql = function() {
// TEXT is deprecated in mssql and it would normally be saved as a non-unicode string.
// Using unicode is just future proof
return 'NVARCHAR(MAX)';
};
var BOOLEAN = function() { var BOOLEAN = function() {
if (!(this instanceof BOOLEAN)) return new BOOLEAN(); if (!(this instanceof BOOLEAN)) return new BOOLEAN();
BaseTypes.BOOLEAN.apply(this, arguments); BaseTypes.BOOLEAN.apply(this, arguments);
...@@ -68,13 +80,70 @@ DATE.prototype.toSql = function() { ...@@ -68,13 +80,70 @@ DATE.prototype.toSql = function() {
return 'DATETIME2'; return 'DATETIME2';
}; };
var INTEGER = function() {
if (!(this instanceof INTEGER)) return new INTEGER();
BaseTypes.INTEGER.apply(this, arguments);
// MSSQL does not support any parameters for integer
this._length = undefined;
this.options.length = undefined;
this._unsigned = undefined;
this._zerofill = undefined;
};
util.inherits(INTEGER, BaseTypes.INTEGER);
var BIGINT = function() {
if (!(this instanceof BIGINT)) return new BIGINT();
BaseTypes.BIGINT.apply(this, arguments);
// MSSQL does not support any parameters for bigint
this._length = undefined;
this.options.length = undefined;
this._unsigned = undefined;
this._zerofill = undefined;
};
util.inherits(BIGINT, BaseTypes.BIGINT);
var REAL = function() {
if (!(this instanceof REAL)) return new REAL();
BaseTypes.REAL.apply(this, arguments);
// MSSQL does not support any parameters for real
this._length = undefined;
this.options.length = undefined;
this._unsigned = undefined;
this._zerofill = undefined;
};
util.inherits(REAL, BaseTypes.REAL);
var FLOAT = function() {
if (!(this instanceof FLOAT)) return new FLOAT();
BaseTypes.FLOAT.apply(this, arguments);
// MSSQL does only support lengths as parameter.
// Values between 1-24 result in 7 digits precision (4 bytes storage size)
// Values between 25-53 result in 15 digits precision (8 bytes storage size)
if (this._decimals) {
this._length = undefined;
this.options.length = undefined;
}
this._unsigned = undefined;
this._zerofill = undefined;
};
util.inherits(FLOAT, BaseTypes.FLOAT);
module.exports = { module.exports = {
BOOLEAN: BOOLEAN, BOOLEAN: BOOLEAN,
STRING: STRING, STRING: STRING,
TEXT: TEXT,
BLOB: BLOB, BLOB: BLOB,
UUID: UUID, UUID: UUID,
DATE: DATE, DATE: DATE,
NOW: NOW NOW: NOW,
INTEGER: INTEGER,
BIGINT: BIGINT,
REAL: REAL,
FLOAT: FLOAT
}; };
_.forIn(module.exports, function (DataType, key) { _.forIn(module.exports, function (DataType, key) {
......
...@@ -45,7 +45,8 @@ MssqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support ...@@ -45,7 +45,8 @@ MssqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support
parser: false, parser: false,
type: true, type: true,
using: false, using: false,
} },
NUMERIC: true
}); });
MssqlDialect.prototype.Query = Query; MssqlDialect.prototype.Query = Query;
......
...@@ -55,10 +55,10 @@ var INTEGER = function() { ...@@ -55,10 +55,10 @@ var INTEGER = function() {
BaseTypes.INTEGER.apply(this, arguments); BaseTypes.INTEGER.apply(this, arguments);
// POSTGRES does not support any parameters for integer // POSTGRES does not support any parameters for integer
this._length = null; this._length = undefined;
this.options.length = null; this.options.length = undefined;
this._unsigned = null; this._unsigned = undefined;
this._zerofill = null; this._zerofill = undefined;
}; };
util.inherits(INTEGER, BaseTypes.INTEGER); util.inherits(INTEGER, BaseTypes.INTEGER);
...@@ -67,10 +67,10 @@ var BIGINT = function() { ...@@ -67,10 +67,10 @@ var BIGINT = function() {
BaseTypes.BIGINT.apply(this, arguments); BaseTypes.BIGINT.apply(this, arguments);
// POSTGRES does not support any parameters for bigint // POSTGRES does not support any parameters for bigint
this._length = null; this._length = undefined;
this.options.length = null; this.options.length = undefined;
this._unsigned = null; this._unsigned = undefined;
this._zerofill = null; this._zerofill = undefined;
}; };
util.inherits(BIGINT, BaseTypes.BIGINT); util.inherits(BIGINT, BaseTypes.BIGINT);
...@@ -79,10 +79,10 @@ var REAL = function() { ...@@ -79,10 +79,10 @@ var REAL = function() {
BaseTypes.REAL.apply(this, arguments); BaseTypes.REAL.apply(this, arguments);
// POSTGRES does not support any parameters for real // POSTGRES does not support any parameters for real
this._length = null; this._length = undefined;
this.options.length = null; this.options.length = undefined;
this._unsigned = null; this._unsigned = undefined;
this._zerofill = null; this._zerofill = undefined;
}; };
util.inherits(REAL, BaseTypes.REAL); util.inherits(REAL, BaseTypes.REAL);
...@@ -91,10 +91,10 @@ var DOUBLE = function() { ...@@ -91,10 +91,10 @@ var DOUBLE = function() {
BaseTypes.DOUBLE.apply(this, arguments); BaseTypes.DOUBLE.apply(this, arguments);
// POSTGRES does not support any parameters for double // POSTGRES does not support any parameters for double
this._length = null; this._length = undefined;
this.options.length = null; this.options.length = undefined;
this._unsigned = null; this._unsigned = undefined;
this._zerofill = null; this._zerofill = undefined;
}; };
util.inherits(DOUBLE, BaseTypes.DOUBLE); util.inherits(DOUBLE, BaseTypes.DOUBLE);
...@@ -102,18 +102,18 @@ var FLOAT = function() { ...@@ -102,18 +102,18 @@ var FLOAT = function() {
if (!(this instanceof FLOAT)) return new FLOAT(); if (!(this instanceof FLOAT)) return new FLOAT();
BaseTypes.FLOAT.apply(this, arguments); BaseTypes.FLOAT.apply(this, arguments);
// POSTGRES does not support any parameters for float // POSTGRES does only support lengths as parameter.
this._length = null; // Values between 1-24 result in REAL
this.options.length = null; // Values between 25-53 result in DOUBLE PRECISION
this._unsigned = null; if (this._decimals) {
this._zerofill = null; this._length = undefined;
this.options.length = undefined;
}
this._unsigned = undefined;
this._zerofill = undefined;
}; };
util.inherits(FLOAT, BaseTypes.FLOAT); util.inherits(FLOAT, BaseTypes.FLOAT);
FLOAT.prototype.toSql = function() {
return 'DOUBLE PRECISION';
};
var BLOB = function() { var BLOB = function() {
if (!(this instanceof BLOB)) return new BLOB(); if (!(this instanceof BLOB)) return new BLOB();
BaseTypes.BLOB.apply(this, arguments); BaseTypes.BLOB.apply(this, arguments);
......
...@@ -41,6 +41,13 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -41,6 +41,13 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
}); });
}); });
suite('TEXT', function () {
testsql('TEXT', DataTypes.TEXT, {
default: 'TEXT',
mssql: 'NVARCHAR(MAX)' // in mssql text is actually representing a non unicode text field
});
});
suite('CHAR', function () { suite('CHAR', function () {
testsql('CHAR', DataTypes.CHAR, { testsql('CHAR', DataTypes.CHAR, {
default: 'CHAR(255)' default: 'CHAR(255)'
...@@ -112,41 +119,48 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -112,41 +119,48 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('INTEGER.UNSIGNED', DataTypes.INTEGER.UNSIGNED, { testsql('INTEGER.UNSIGNED', DataTypes.INTEGER.UNSIGNED, {
default: 'INTEGER UNSIGNED', default: 'INTEGER UNSIGNED',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER.UNSIGNED.ZEROFILL', DataTypes.INTEGER.UNSIGNED.ZEROFILL, { testsql('INTEGER.UNSIGNED.ZEROFILL', DataTypes.INTEGER.UNSIGNED.ZEROFILL, {
default: 'INTEGER UNSIGNED ZEROFILL', default: 'INTEGER UNSIGNED ZEROFILL',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER(11)', DataTypes.INTEGER(11), { testsql('INTEGER(11)', DataTypes.INTEGER(11), {
default: 'INTEGER(11)', default: 'INTEGER(11)',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER(11).UNSIGNED', DataTypes.INTEGER(11).UNSIGNED, { testsql('INTEGER(11).UNSIGNED', DataTypes.INTEGER(11).UNSIGNED, {
default: 'INTEGER(11) UNSIGNED', default: 'INTEGER(11) UNSIGNED',
sqlite: 'INTEGER UNSIGNED(11)', sqlite: 'INTEGER UNSIGNED(11)',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER(11).UNSIGNED.ZEROFILL', DataTypes.INTEGER(11).UNSIGNED.ZEROFILL, { testsql('INTEGER(11).UNSIGNED.ZEROFILL', DataTypes.INTEGER(11).UNSIGNED.ZEROFILL, {
default: 'INTEGER(11) UNSIGNED ZEROFILL', default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)', sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER(11).ZEROFILL', DataTypes.INTEGER(11).ZEROFILL, { testsql('INTEGER(11).ZEROFILL', DataTypes.INTEGER(11).ZEROFILL, {
default: 'INTEGER(11) ZEROFILL', default: 'INTEGER(11) ZEROFILL',
sqlite: 'INTEGER ZEROFILL(11)', sqlite: 'INTEGER ZEROFILL(11)',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
testsql('INTEGER(11).ZEROFILL.UNSIGNED', DataTypes.INTEGER(11).ZEROFILL.UNSIGNED, { testsql('INTEGER(11).ZEROFILL.UNSIGNED', DataTypes.INTEGER(11).ZEROFILL.UNSIGNED, {
default: 'INTEGER(11) UNSIGNED ZEROFILL', default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)', sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER' postgres: 'INTEGER',
mssql: 'INTEGER'
}); });
}); });
...@@ -157,41 +171,48 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -157,41 +171,48 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('BIGINT.UNSIGNED', DataTypes.BIGINT.UNSIGNED, { testsql('BIGINT.UNSIGNED', DataTypes.BIGINT.UNSIGNED, {
default: 'BIGINT UNSIGNED', default: 'BIGINT UNSIGNED',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT.UNSIGNED.ZEROFILL', DataTypes.BIGINT.UNSIGNED.ZEROFILL, { testsql('BIGINT.UNSIGNED.ZEROFILL', DataTypes.BIGINT.UNSIGNED.ZEROFILL, {
default: 'BIGINT UNSIGNED ZEROFILL', default: 'BIGINT UNSIGNED ZEROFILL',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT(11)', DataTypes.BIGINT(11), { testsql('BIGINT(11)', DataTypes.BIGINT(11), {
default: 'BIGINT(11)', default: 'BIGINT(11)',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT(11).UNSIGNED', DataTypes.BIGINT(11).UNSIGNED, { testsql('BIGINT(11).UNSIGNED', DataTypes.BIGINT(11).UNSIGNED, {
default: 'BIGINT(11) UNSIGNED', default: 'BIGINT(11) UNSIGNED',
sqlite: 'BIGINT UNSIGNED(11)', sqlite: 'BIGINT UNSIGNED(11)',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT(11).UNSIGNED.ZEROFILL', DataTypes.BIGINT(11).UNSIGNED.ZEROFILL, { testsql('BIGINT(11).UNSIGNED.ZEROFILL', DataTypes.BIGINT(11).UNSIGNED.ZEROFILL, {
default: 'BIGINT(11) UNSIGNED ZEROFILL', default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)', sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT(11).ZEROFILL', DataTypes.BIGINT(11).ZEROFILL, { testsql('BIGINT(11).ZEROFILL', DataTypes.BIGINT(11).ZEROFILL, {
default: 'BIGINT(11) ZEROFILL', default: 'BIGINT(11) ZEROFILL',
sqlite: 'BIGINT ZEROFILL(11)', sqlite: 'BIGINT ZEROFILL(11)',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
testsql('BIGINT(11).ZEROFILL.UNSIGNED', DataTypes.BIGINT(11).ZEROFILL.UNSIGNED, { testsql('BIGINT(11).ZEROFILL.UNSIGNED', DataTypes.BIGINT(11).ZEROFILL.UNSIGNED, {
default: 'BIGINT(11) UNSIGNED ZEROFILL', default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)', sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT' postgres: 'BIGINT',
mssql: 'BIGINT'
}); });
}); });
...@@ -202,65 +223,76 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -202,65 +223,76 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('REAL.UNSIGNED', DataTypes.REAL.UNSIGNED, { testsql('REAL.UNSIGNED', DataTypes.REAL.UNSIGNED, {
default: 'REAL UNSIGNED', default: 'REAL UNSIGNED',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11)', DataTypes.REAL(11), { testsql('REAL(11)', DataTypes.REAL(11), {
default: 'REAL(11)', default: 'REAL(11)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11).UNSIGNED', DataTypes.REAL(11).UNSIGNED, { testsql('REAL(11).UNSIGNED', DataTypes.REAL(11).UNSIGNED, {
default: 'REAL(11) UNSIGNED', default: 'REAL(11) UNSIGNED',
sqlite: 'REAL UNSIGNED(11)', sqlite: 'REAL UNSIGNED(11)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11).UNSIGNED.ZEROFILL', DataTypes.REAL(11).UNSIGNED.ZEROFILL, { testsql('REAL(11).UNSIGNED.ZEROFILL', DataTypes.REAL(11).UNSIGNED.ZEROFILL, {
default: 'REAL(11) UNSIGNED ZEROFILL', default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)', sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11).ZEROFILL', DataTypes.REAL(11).ZEROFILL, { testsql('REAL(11).ZEROFILL', DataTypes.REAL(11).ZEROFILL, {
default: 'REAL(11) ZEROFILL', default: 'REAL(11) ZEROFILL',
sqlite: 'REAL ZEROFILL(11)', sqlite: 'REAL ZEROFILL(11)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11).ZEROFILL.UNSIGNED', DataTypes.REAL(11).ZEROFILL.UNSIGNED, { testsql('REAL(11).ZEROFILL.UNSIGNED', DataTypes.REAL(11).ZEROFILL.UNSIGNED, {
default: 'REAL(11) UNSIGNED ZEROFILL', default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)', sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11, 12)', DataTypes.REAL(11, 12), { testsql('REAL(11, 12)', DataTypes.REAL(11, 12), {
default: 'REAL(11,12)', default: 'REAL(11,12)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11, 12).UNSIGNED', DataTypes.REAL(11, 12).UNSIGNED, { testsql('REAL(11, 12).UNSIGNED', DataTypes.REAL(11, 12).UNSIGNED, {
default: 'REAL(11,12) UNSIGNED', default: 'REAL(11,12) UNSIGNED',
sqlite: 'REAL UNSIGNED(11,12)', sqlite: 'REAL UNSIGNED(11,12)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11, 12).UNSIGNED.ZEROFILL', DataTypes.REAL(11, 12).UNSIGNED.ZEROFILL, { testsql('REAL(11, 12).UNSIGNED.ZEROFILL', DataTypes.REAL(11, 12).UNSIGNED.ZEROFILL, {
default: 'REAL(11,12) UNSIGNED ZEROFILL', default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)', sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11, 12).ZEROFILL', DataTypes.REAL(11, 12).ZEROFILL, { testsql('REAL(11, 12).ZEROFILL', DataTypes.REAL(11, 12).ZEROFILL, {
default: 'REAL(11,12) ZEROFILL', default: 'REAL(11,12) ZEROFILL',
sqlite: 'REAL ZEROFILL(11,12)', sqlite: 'REAL ZEROFILL(11,12)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
testsql('REAL(11, 12).ZEROFILL.UNSIGNED', DataTypes.REAL(11, 12).ZEROFILL.UNSIGNED, { testsql('REAL(11, 12).ZEROFILL.UNSIGNED', DataTypes.REAL(11, 12).ZEROFILL.UNSIGNED, {
default: 'REAL(11,12) UNSIGNED ZEROFILL', default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)', sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL' postgres: 'REAL',
mssql: 'REAL'
}); });
}); });
...@@ -336,70 +368,81 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -336,70 +368,81 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
suite('FLOAT', function () { suite('FLOAT', function () {
testsql('FLOAT', DataTypes.FLOAT, { testsql('FLOAT', DataTypes.FLOAT, {
default: 'FLOAT', default: 'FLOAT',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT'
}); });
testsql('FLOAT.UNSIGNED', DataTypes.FLOAT.UNSIGNED, { testsql('FLOAT.UNSIGNED', DataTypes.FLOAT.UNSIGNED, {
default: 'FLOAT UNSIGNED', default: 'FLOAT UNSIGNED',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
testsql('FLOAT(11)', DataTypes.FLOAT(11), { testsql('FLOAT(11)', DataTypes.FLOAT(11), {
default: 'FLOAT(11)', default: 'FLOAT(11)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT(11)', // 1-24 = 4 bytes; 35-53 = 8 bytes
mssql: 'FLOAT(11)' // 1-24 = 4 bytes; 35-53 = 8 bytes
}); });
testsql('FLOAT(11).UNSIGNED', DataTypes.FLOAT(11).UNSIGNED, { testsql('FLOAT(11).UNSIGNED', DataTypes.FLOAT(11).UNSIGNED, {
default: 'FLOAT(11) UNSIGNED', default: 'FLOAT(11) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11)', sqlite: 'FLOAT UNSIGNED(11)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)'
}); });
testsql('FLOAT(11).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11).UNSIGNED.ZEROFILL, { testsql('FLOAT(11).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11).UNSIGNED.ZEROFILL, {
default: 'FLOAT(11) UNSIGNED ZEROFILL', default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)', sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)'
}); });
testsql('FLOAT(11).ZEROFILL', DataTypes.FLOAT(11).ZEROFILL, { testsql('FLOAT(11).ZEROFILL', DataTypes.FLOAT(11).ZEROFILL, {
default: 'FLOAT(11) ZEROFILL', default: 'FLOAT(11) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11)', sqlite: 'FLOAT ZEROFILL(11)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)'
}); });
testsql('FLOAT(11).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11).ZEROFILL.UNSIGNED, { testsql('FLOAT(11).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11) UNSIGNED ZEROFILL', default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)', sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT(11)',
mssql: 'FLOAT(11)'
}); });
testsql('FLOAT(11, 12)', DataTypes.FLOAT(11, 12), { testsql('FLOAT(11, 12)', DataTypes.FLOAT(11, 12), {
default: 'FLOAT(11,12)', default: 'FLOAT(11,12)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
testsql('FLOAT(11, 12).UNSIGNED', DataTypes.FLOAT(11, 12).UNSIGNED, { testsql('FLOAT(11, 12).UNSIGNED', DataTypes.FLOAT(11, 12).UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED', default: 'FLOAT(11,12) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11,12)', sqlite: 'FLOAT UNSIGNED(11,12)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
testsql('FLOAT(11, 12).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11, 12).UNSIGNED.ZEROFILL, { testsql('FLOAT(11, 12).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11, 12).UNSIGNED.ZEROFILL, {
default: 'FLOAT(11,12) UNSIGNED ZEROFILL', default: 'FLOAT(11,12) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)', sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
testsql('FLOAT(11, 12).ZEROFILL', DataTypes.FLOAT(11, 12).ZEROFILL, { testsql('FLOAT(11, 12).ZEROFILL', DataTypes.FLOAT(11, 12).ZEROFILL, {
default: 'FLOAT(11,12) ZEROFILL', default: 'FLOAT(11,12) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11,12)', sqlite: 'FLOAT ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
testsql('FLOAT(11, 12).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11, 12).ZEROFILL.UNSIGNED, { testsql('FLOAT(11, 12).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11, 12).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED ZEROFILL', default: 'FLOAT(11,12) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)', sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION' postgres: 'FLOAT',
mssql: 'FLOAT'
}); });
}); });
...@@ -483,6 +526,10 @@ suite(Support.getTestDialectTeaser('SQL'), function() { ...@@ -483,6 +526,10 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
postgres: 'TIMESTAMP WITH TIME ZONE[]' postgres: 'TIMESTAMP WITH TIME ZONE[]'
}); });
testsql('ARRAY(BOOLEAN)', DataTypes.ARRAY(DataTypes.BOOLEAN), {
postgres: 'BOOLEAN[]'
});
testsql('ARRAY(DECIMAL)', DataTypes.ARRAY(DataTypes.DECIMAL), { testsql('ARRAY(DECIMAL)', DataTypes.ARRAY(DataTypes.DECIMAL), {
postgres: 'DECIMAL[]' postgres: 'DECIMAL[]'
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!