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

Commit 89cca907 by Ruben Bridgewater

Fixed a couple postgres type errors, new type unit tests and insert REAL as postgres type

Add more tests, add and fix some more data types in postgres

Fix sqlite data types

Support float in pg (they use an affinity)

Use inheritance

Mysql supports numeric as a synonym for decimal
1 parent d1662c13
......@@ -197,13 +197,12 @@ util.inherits(BIGINT, NUMBER);
BIGINT.prototype.key = BIGINT.key = 'BIGINT';
/**
* Floating point number. Accepts one or two arguments for precision
* Floating point number (4-byte precision). Accepts one or two arguments for precision
*
* Available properties: `UNSIGNED`, `ZEROFILL`
*
* @property FLOAT
*/
var FLOAT = function(length, decimals) {
var options = typeof length === 'object' && length || {
length: length,
......@@ -217,6 +216,44 @@ util.inherits(FLOAT, NUMBER);
FLOAT.prototype.key = FLOAT.key = 'FLOAT';
/**
* Floating point number (4-byte precision). Accepts one or two arguments for precision
*
* Available properties: `UNSIGNED`, `ZEROFILL`
*
* @property REAL
*/
var REAL = function(length, decimals) {
var options = typeof length === 'object' && length || {
length: length,
decimals: decimals
};
if (!(this instanceof REAL)) return new REAL(options);
NUMBER.call(this, options);
};
util.inherits(REAL, NUMBER);
REAL.prototype.key = REAL.key = 'REAL';
/**
* Floating point number (8-byte precision). Accepts one or two arguments for precision
*
* Available properties: `UNSIGNED`, `ZEROFILL`
*
* @property DOUBLE
*/
var DOUBLE = function(length, decimals) {
var options = typeof length === 'object' && length || {
length: length,
decimals: decimals
};
if (!(this instanceof DOUBLE)) return new DOUBLE(options);
NUMBER.call(this, options);
};
util.inherits(DOUBLE, NUMBER);
DOUBLE.prototype.key = DOUBLE.key = 'DOUBLE PRECISION';
/**
* Decimal number. Accepts one or two arguments for precision
*
* Available properties: `UNSIGNED`, `ZEROFILL`
......@@ -526,14 +563,14 @@ ARRAY.is = function(obj, type) {
return obj instanceof ARRAY && obj.type instanceof type;
};
var helpers = {
BINARY: [STRING, CHAR],
UNSIGNED: [NUMBER, INTEGER, BIGINT, FLOAT],
ZEROFILL: [NUMBER, INTEGER, BIGINT, FLOAT],
UNSIGNED: [NUMBER, INTEGER, BIGINT, FLOAT, DOUBLE, REAL],
ZEROFILL: [NUMBER, INTEGER, BIGINT, FLOAT, DOUBLE, REAL],
PRECISION: [DECIMAL],
SCALE: [DECIMAL]
};
Object.keys(helpers).forEach(function (helper) {
helpers[helper].forEach(function (DataType) {
if (!DataType[helper]) {
......@@ -566,6 +603,7 @@ module.exports = {
NOW: NOW,
BLOB: BLOB,
DECIMAL: DECIMAL,
NUMERIC: DECIMAL,
UUID: UUID,
UUIDV1: UUIDV1,
UUIDV4: UUIDV4,
......@@ -576,5 +614,8 @@ module.exports = {
ARRAY: ARRAY,
NONE: VIRTUAL,
ENUM: ENUM,
RANGE: RANGE
RANGE: RANGE,
REAL: REAL,
DOUBLE: DOUBLE,
'DOUBLE PRECISION': DOUBLE
};
......@@ -30,7 +30,8 @@ MysqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support
parser: true,
type: true,
using: 1,
}
},
NUMERIC: true
});
MysqlDialect.prototype.Query = Query;
......
......@@ -54,9 +54,11 @@ var INTEGER = function() {
if (!(this instanceof INTEGER)) return new INTEGER();
BaseTypes.INTEGER.apply(this, arguments);
// POSTGRES does not support length on INTEGER
delete this._length;
delete this.options.length;
// POSTGRES does not support any parameters for integer
this._length = null;
this.options.length = null;
this._unsigned = null;
this._zerofill = null;
};
util.inherits(INTEGER, BaseTypes.INTEGER);
......@@ -64,12 +66,54 @@ var BIGINT = function() {
if (!(this instanceof BIGINT)) return new BIGINT();
BaseTypes.BIGINT.apply(this, arguments);
// POSTGRES does not support length on BIGINT
delete this._length;
delete this.options.length;
// POSTGRES does not support any parameters for bigint
this._length = null;
this.options.length = null;
this._unsigned = null;
this._zerofill = null;
};
util.inherits(BIGINT, BaseTypes.BIGINT);
var REAL = function() {
if (!(this instanceof REAL)) return new REAL();
BaseTypes.REAL.apply(this, arguments);
// POSTGRES does not support any parameters for real
this._length = null;
this.options.length = null;
this._unsigned = null;
this._zerofill = null;
};
util.inherits(REAL, BaseTypes.REAL);
var DOUBLE = function() {
if (!(this instanceof DOUBLE)) return new DOUBLE();
BaseTypes.DOUBLE.apply(this, arguments);
// POSTGRES does not support any parameters for double
this._length = null;
this.options.length = null;
this._unsigned = null;
this._zerofill = null;
};
util.inherits(DOUBLE, BaseTypes.DOUBLE);
var FLOAT = function() {
if (!(this instanceof FLOAT)) return new FLOAT();
BaseTypes.FLOAT.apply(this, arguments);
// POSTGRES does not support any parameters for float
this._length = null;
this.options.length = null;
this._unsigned = null;
this._zerofill = null;
};
util.inherits(FLOAT, BaseTypes.FLOAT);
FLOAT.prototype.toSql = function() {
return 'DOUBLE PRECISION';
};
var BLOB = function() {
if (!(this instanceof BLOB)) return new BLOB();
BaseTypes.BLOB.apply(this, arguments);
......@@ -87,7 +131,10 @@ module.exports = {
DATE: DATE,
INTEGER: INTEGER,
BIGINT: BIGINT,
BLOB: BLOB
BLOB: BLOB,
REAL: REAL,
'DOUBLE PRECISION': DOUBLE,
FLOAT: FLOAT
};
_.forIn(module.exports, function (DataType, key) {
......
......@@ -27,7 +27,6 @@ PostgresDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.supp
'EXCEPTION': true,
'ON DUPLICATE KEY': false,
'ORDER NULLS': true,
'ARRAY': true,
returnValues: {
returning: true
},
......@@ -42,6 +41,8 @@ PostgresDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.supp
using: 2,
where: true
},
NUMERIC: true,
ARRAY: true,
JSON: true,
JSONB: true
});
......
......@@ -97,11 +97,41 @@ FLOAT.prototype.toSql = function() {
return NUMBER.prototype.toSql.call(this);
};
var DOUBLE = function(length, decimals) {
var options = typeof length === 'object' && length || {
length: length,
decimals: decimals
};
if (!(this instanceof DOUBLE)) return new DOUBLE(options);
NUMBER.call(this, options);
};
util.inherits(DOUBLE, BaseTypes.DOUBLE);
DOUBLE.prototype.key = DOUBLE.key = 'DOUBLE PRECISION';
DOUBLE.prototype.toSql = function() {
return NUMBER.prototype.toSql.call(this);
};
var REAL = function(length, decimals) {
var options = typeof length === 'object' && length || {
length: length,
decimals: decimals
};
if (!(this instanceof REAL)) return new REAL(options);
NUMBER.call(this, options);
};
util.inherits(REAL, BaseTypes.REAL);
REAL.prototype.key = REAL.key = 'REAL';
REAL.prototype.toSql = function() {
return NUMBER.prototype.toSql.call(this);
};
module.exports = {
STRING: STRING,
CHAR: CHAR,
NUMBER: NUMBER,
FLOAT: FLOAT,
REAL: REAL,
'DOUBLE PRECISION': DOUBLE,
INTEGER: INTEGER,
BIGINT: BIGINT
};
......
......@@ -103,11 +103,13 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
});
testsql('INTEGER.UNSIGNED', DataTypes.INTEGER.UNSIGNED, {
default: 'INTEGER UNSIGNED'
default: 'INTEGER UNSIGNED',
postgres: 'INTEGER'
});
testsql('INTEGER.UNSIGNED.ZEROFILL', DataTypes.INTEGER.UNSIGNED.ZEROFILL, {
default: 'INTEGER UNSIGNED ZEROFILL'
default: 'INTEGER UNSIGNED ZEROFILL',
postgres: 'INTEGER'
});
testsql('INTEGER(11)', DataTypes.INTEGER(11), {
......@@ -118,25 +120,25 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('INTEGER(11).UNSIGNED', DataTypes.INTEGER(11).UNSIGNED, {
default: 'INTEGER(11) UNSIGNED',
sqlite: 'INTEGER UNSIGNED(11)',
postgres: 'INTEGER UNSIGNED'
postgres: 'INTEGER'
});
testsql('INTEGER(11).UNSIGNED.ZEROFILL', DataTypes.INTEGER(11).UNSIGNED.ZEROFILL, {
default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER UNSIGNED ZEROFILL'
postgres: 'INTEGER'
});
testsql('INTEGER(11).ZEROFILL', DataTypes.INTEGER(11).ZEROFILL, {
default: 'INTEGER(11) ZEROFILL',
sqlite: 'INTEGER ZEROFILL(11)',
postgres: 'INTEGER ZEROFILL'
postgres: 'INTEGER'
});
testsql('INTEGER(11).ZEROFILL.UNSIGNED', DataTypes.INTEGER(11).ZEROFILL.UNSIGNED, {
default: 'INTEGER(11) UNSIGNED ZEROFILL',
sqlite: 'INTEGER UNSIGNED ZEROFILL(11)',
postgres: 'INTEGER UNSIGNED ZEROFILL'
postgres: 'INTEGER'
});
});
......@@ -146,11 +148,13 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
});
testsql('BIGINT.UNSIGNED', DataTypes.BIGINT.UNSIGNED, {
default: 'BIGINT UNSIGNED'
default: 'BIGINT UNSIGNED',
postgres: 'BIGINT'
});
testsql('BIGINT.UNSIGNED.ZEROFILL', DataTypes.BIGINT.UNSIGNED.ZEROFILL, {
default: 'BIGINT UNSIGNED ZEROFILL'
default: 'BIGINT UNSIGNED ZEROFILL',
postgres: 'BIGINT'
});
testsql('BIGINT(11)', DataTypes.BIGINT(11), {
......@@ -161,87 +165,246 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('BIGINT(11).UNSIGNED', DataTypes.BIGINT(11).UNSIGNED, {
default: 'BIGINT(11) UNSIGNED',
sqlite: 'BIGINT UNSIGNED(11)',
postgres: 'BIGINT UNSIGNED'
postgres: 'BIGINT'
});
testsql('BIGINT(11).UNSIGNED.ZEROFILL', DataTypes.BIGINT(11).UNSIGNED.ZEROFILL, {
default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT UNSIGNED ZEROFILL'
postgres: 'BIGINT'
});
testsql('BIGINT(11).ZEROFILL', DataTypes.BIGINT(11).ZEROFILL, {
default: 'BIGINT(11) ZEROFILL',
sqlite: 'BIGINT ZEROFILL(11)',
postgres: 'BIGINT ZEROFILL'
postgres: 'BIGINT'
});
testsql('BIGINT(11).ZEROFILL.UNSIGNED', DataTypes.BIGINT(11).ZEROFILL.UNSIGNED, {
default: 'BIGINT(11) UNSIGNED ZEROFILL',
sqlite: 'BIGINT UNSIGNED ZEROFILL(11)',
postgres: 'BIGINT UNSIGNED ZEROFILL'
postgres: 'BIGINT'
});
});
suite('REAL', function () {
testsql('REAL', DataTypes.REAL, {
default: 'REAL'
});
testsql('REAL.UNSIGNED', DataTypes.REAL.UNSIGNED, {
default: 'REAL UNSIGNED',
postgres: 'REAL'
});
testsql('REAL(11)', DataTypes.REAL(11), {
default: 'REAL(11)',
postgres: 'REAL'
});
testsql('REAL(11).UNSIGNED', DataTypes.REAL(11).UNSIGNED, {
default: 'REAL(11) UNSIGNED',
sqlite: 'REAL UNSIGNED(11)',
postgres: 'REAL'
});
testsql('REAL(11).UNSIGNED.ZEROFILL', DataTypes.REAL(11).UNSIGNED.ZEROFILL, {
default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL'
});
testsql('REAL(11).ZEROFILL', DataTypes.REAL(11).ZEROFILL, {
default: 'REAL(11) ZEROFILL',
sqlite: 'REAL ZEROFILL(11)',
postgres: 'REAL'
});
testsql('REAL(11).ZEROFILL.UNSIGNED', DataTypes.REAL(11).ZEROFILL.UNSIGNED, {
default: 'REAL(11) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11)',
postgres: 'REAL'
});
testsql('REAL(11, 12)', DataTypes.REAL(11, 12), {
default: 'REAL(11,12)',
postgres: 'REAL'
});
testsql('REAL(11, 12).UNSIGNED', DataTypes.REAL(11, 12).UNSIGNED, {
default: 'REAL(11,12) UNSIGNED',
sqlite: 'REAL UNSIGNED(11,12)',
postgres: 'REAL'
});
testsql('REAL(11, 12).UNSIGNED.ZEROFILL', DataTypes.REAL(11, 12).UNSIGNED.ZEROFILL, {
default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL'
});
testsql('REAL(11, 12).ZEROFILL', DataTypes.REAL(11, 12).ZEROFILL, {
default: 'REAL(11,12) ZEROFILL',
sqlite: 'REAL ZEROFILL(11,12)',
postgres: 'REAL'
});
testsql('REAL(11, 12).ZEROFILL.UNSIGNED', DataTypes.REAL(11, 12).ZEROFILL.UNSIGNED, {
default: 'REAL(11,12) UNSIGNED ZEROFILL',
sqlite: 'REAL UNSIGNED ZEROFILL(11,12)',
postgres: 'REAL'
});
});
suite('DOUBLE PRECISION', function () {
testsql('DOUBLE', DataTypes.DOUBLE, {
default: 'DOUBLE PRECISION'
});
testsql('DOUBLE.UNSIGNED', DataTypes.DOUBLE.UNSIGNED, {
default: 'DOUBLE PRECISION UNSIGNED',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11)', DataTypes.DOUBLE(11), {
default: 'DOUBLE PRECISION(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).UNSIGNED', DataTypes.DOUBLE(11).UNSIGNED, {
default: 'DOUBLE PRECISION(11) UNSIGNED',
sqlite: 'DOUBLE PRECISION UNSIGNED(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).UNSIGNED.ZEROFILL', DataTypes.DOUBLE(11).UNSIGNED.ZEROFILL, {
default: 'DOUBLE PRECISION(11) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).ZEROFILL', DataTypes.DOUBLE(11).ZEROFILL, {
default: 'DOUBLE PRECISION(11) ZEROFILL',
sqlite: 'DOUBLE PRECISION ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11).ZEROFILL.UNSIGNED', DataTypes.DOUBLE(11).ZEROFILL.UNSIGNED, {
default: 'DOUBLE PRECISION(11) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12)', DataTypes.DOUBLE(11, 12), {
default: 'DOUBLE PRECISION(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).UNSIGNED', DataTypes.DOUBLE(11, 12).UNSIGNED, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED',
sqlite: 'DOUBLE PRECISION UNSIGNED(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).UNSIGNED.ZEROFILL', DataTypes.DOUBLE(11, 12).UNSIGNED.ZEROFILL, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).ZEROFILL', DataTypes.DOUBLE(11, 12).ZEROFILL, {
default: 'DOUBLE PRECISION(11,12) ZEROFILL',
sqlite: 'DOUBLE PRECISION ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('DOUBLE(11, 12).ZEROFILL.UNSIGNED', DataTypes.DOUBLE(11, 12).ZEROFILL.UNSIGNED, {
default: 'DOUBLE PRECISION(11,12) UNSIGNED ZEROFILL',
sqlite: 'DOUBLE PRECISION UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
});
suite('FLOAT', function () {
testsql('FLOAT', DataTypes.FLOAT, {
default: 'FLOAT'
default: 'FLOAT',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT.UNSIGNED', DataTypes.FLOAT.UNSIGNED, {
default: 'FLOAT UNSIGNED'
default: 'FLOAT UNSIGNED',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11)', DataTypes.FLOAT(11), {
default: 'FLOAT(11)'
default: 'FLOAT(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11).UNSIGNED', DataTypes.FLOAT(11).UNSIGNED, {
default: 'FLOAT(11) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11)'
sqlite: 'FLOAT UNSIGNED(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11).UNSIGNED.ZEROFILL', DataTypes.FLOAT(11).UNSIGNED.ZEROFILL, {
default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)'
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11).ZEROFILL', DataTypes.FLOAT(11).ZEROFILL, {
default: 'FLOAT(11) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11)'
sqlite: 'FLOAT ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)'
sqlite: 'FLOAT UNSIGNED ZEROFILL(11)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11, 12)', DataTypes.FLOAT(11, 12), {
default: 'FLOAT(11,12)'
default: 'FLOAT(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11, 12).UNSIGNED', DataTypes.FLOAT(11, 12).UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED',
sqlite: 'FLOAT UNSIGNED(11,12)'
sqlite: 'FLOAT UNSIGNED(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11, 12).UNSIGNED.ZEROFILL', DataTypes.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'
});
testsql('FLOAT(11, 12).ZEROFILL', DataTypes.FLOAT(11, 12).ZEROFILL, {
default: 'FLOAT(11,12) ZEROFILL',
sqlite: 'FLOAT ZEROFILL(11,12)'
sqlite: 'FLOAT ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
testsql('FLOAT(11, 12).ZEROFILL.UNSIGNED', DataTypes.FLOAT(11, 12).ZEROFILL.UNSIGNED, {
default: 'FLOAT(11,12) UNSIGNED ZEROFILL',
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)'
sqlite: 'FLOAT UNSIGNED ZEROFILL(11,12)',
postgres: 'DOUBLE PRECISION'
});
});
if (current.dialect.supports.NUMERIC) {
testsql('NUMERIC', DataTypes.NUMERIC, {
default: 'DECIMAL'
});
testsql('NUMERIC(15,5)', DataTypes.NUMERIC(15,5), {
default: 'DECIMAL(15,5)'
});
}
suite('DECIMAL', function () {
testsql('DECIMAL', DataTypes.DECIMAL, {
default: 'DECIMAL'
......@@ -291,6 +454,58 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql('ARRAY(VARCHAR(100))', DataTypes.ARRAY(DataTypes.STRING(100)), {
postgres: 'VARCHAR(100)[]'
});
testsql('ARRAY(INTEGER)', DataTypes.ARRAY(DataTypes.INTEGER), {
postgres: 'INTEGER[]'
});
testsql('ARRAY(HSTORE)', DataTypes.ARRAY(DataTypes.HSTORE), {
postgres: 'HSTORE[]'
});
testsql('ARRAY(ARRAY(VARCHAR(255)))', DataTypes.ARRAY(DataTypes.ARRAY(DataTypes.STRING)), {
postgres: 'VARCHAR(255)[][]'
});
testsql('ARRAY(TEXT)', DataTypes.ARRAY(DataTypes.TEXT), {
postgres: 'TEXT[]'
});
testsql('ARRAY(DATE)', DataTypes.ARRAY(DataTypes.DATE), {
postgres: 'TIMESTAMP WITH TIME ZONE[]'
});
testsql('ARRAY(DECIMAL)', DataTypes.ARRAY(DataTypes.DECIMAL), {
postgres: 'DECIMAL[]'
});
testsql('ARRAY(DECIMAL(6))', DataTypes.ARRAY(DataTypes.DECIMAL(6)), {
postgres: 'DECIMAL(6)[]'
});
testsql('ARRAY(DECIMAL(6,4))', DataTypes.ARRAY(DataTypes.DECIMAL(6,4)), {
postgres: 'DECIMAL(6,4)[]'
});
testsql('ARRAY(DOUBLE)', DataTypes.ARRAY(DataTypes.DOUBLE), {
postgres: 'DOUBLE PRECISION[]'
});
testsql('ARRAY(REAL))', DataTypes.ARRAY(DataTypes.REAL), {
postgres: 'REAL[]'
});
if (current.dialect.supports.JSON) {
testsql('ARRAY(JSON)', DataTypes.ARRAY(DataTypes.JSON), {
postgres: 'JSON[]'
});
}
if (current.dialect.supports.JSONB) {
testsql('ARRAY(JSONB)', DataTypes.ARRAY(DataTypes.JSONB), {
postgres: 'JSONB[]'
});
}
});
}
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!