sequelize
Advanced tools
Comparing version 6.31.1 to 6.32.0
@@ -108,2 +108,6 @@ "use strict"; | ||
case "ORA-12514": | ||
case "NJS-511": | ||
case "NJS-516": | ||
case "NJS-517": | ||
case "NJS-520": | ||
throw new SequelizeErrors.ConnectionRefusedError(err); | ||
@@ -113,6 +117,16 @@ case "ORA-28000": | ||
case "ORA-01017": | ||
case "NJS-506": | ||
throw new SequelizeErrors.AccessDeniedError(err); | ||
case "ORA-12541": | ||
case "NJS-503": | ||
case "NJS-508": | ||
case "NJS-507": | ||
throw new SequelizeErrors.HostNotReachableError(err); | ||
case "NJS-512": | ||
case "NJS-515": | ||
case "NJS-518": | ||
case "NJS-519": | ||
throw new SequelizeErrors.InvalidConnectionError(err); | ||
case "ORA-12170": | ||
case "NJS-510": | ||
throw new SequelizeErrors.ConnectionTimedOutError(err); | ||
@@ -119,0 +133,0 @@ default: |
@@ -160,6 +160,2 @@ "use strict"; | ||
class DECIMAL extends BaseTypes.DECIMAL { | ||
constructor() { | ||
super(); | ||
this.key = "DECIMAL"; | ||
} | ||
toSql() { | ||
@@ -197,3 +193,6 @@ let result = ""; | ||
toSql() { | ||
return "NUMBER(5)"; | ||
if (this._length) { | ||
return `NUMBER(${this._length},0)`; | ||
} | ||
return "SMALLINT"; | ||
} | ||
@@ -245,2 +244,8 @@ _getBindDef(oracledb) { | ||
class INTEGER extends BaseTypes.INTEGER { | ||
toSql() { | ||
if (this._length) { | ||
return `NUMBER(${this._length},0)`; | ||
} | ||
return "INTEGER"; | ||
} | ||
_getBindDef(oracledb) { | ||
@@ -247,0 +252,0 @@ return { type: oracledb.DB_TYPE_NUMBER }; |
@@ -640,5 +640,15 @@ "use strict"; | ||
attribute.type._unsigned = false; | ||
unsignedTemplate += ` check(${this.quoteIdentifier(attribute.field)} >= 0)`; | ||
unsignedTemplate += ` check(${this.quoteIdentifier(options.attributeName)} >= 0)`; | ||
} | ||
template = attribute.type.toString(); | ||
if (attribute.type && attribute.type !== "TEXT" && attribute.type._binary !== true && Utils.defaultValueSchemable(attribute.defaultValue)) { | ||
template += ` DEFAULT ${this.escape(attribute.defaultValue)}`; | ||
} | ||
if (!attribute.autoIncrement) { | ||
if (attribute.allowNull === false) { | ||
template += " NOT NULL"; | ||
} else if (!attribute.primaryKey && !Utils.defaultValueSchemable(attribute.defaultValue)) { | ||
template += " NULL"; | ||
} | ||
} | ||
template += unsignedTemplate; | ||
@@ -648,12 +658,2 @@ } else { | ||
} | ||
if (attribute.type && attribute.type !== "TEXT" && attribute.type._binary !== true && Utils.defaultValueSchemable(attribute.defaultValue)) { | ||
template += ` DEFAULT ${this.escape(attribute.defaultValue)}`; | ||
} | ||
if (!attribute.autoIncrement) { | ||
if (attribute.allowNull === false) { | ||
template += " NOT NULL"; | ||
} else if (!attribute.primaryKey && !Utils.defaultValueSchemable(attribute.defaultValue)) { | ||
template += " NULL"; | ||
} | ||
} | ||
if (attribute.unique === true && !attribute.primaryKey) { | ||
@@ -660,0 +660,0 @@ template += " UNIQUE"; |
@@ -114,2 +114,4 @@ "use strict"; | ||
this.bindParameters = parameters; | ||
} else if (this.isRawQuery()) { | ||
this.bindParameters = parameters; | ||
} else { | ||
@@ -116,0 +118,0 @@ Object.values(parameters).forEach((value) => { |
{ | ||
"name": "sequelize", | ||
"description": "Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.", | ||
"version": "6.31.1", | ||
"version": "6.32.0", | ||
"funding": [ | ||
@@ -24,13 +24,13 @@ { | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"import": "./lib/index.mjs", | ||
"require": "./lib/index.js", | ||
"types": "./types/index.d.ts" | ||
"require": "./lib/index.js" | ||
}, | ||
"./lib/*": { | ||
"default": "./lib/*.js", | ||
"types": "./types/*.d.ts" | ||
"types": "./types/*.d.ts", | ||
"default": "./lib/*.js" | ||
}, | ||
"./lib/errors": { | ||
"default": "./lib/errors/index.js", | ||
"types": "./types/errors/index.d.ts" | ||
"types": "./types/errors/index.d.ts", | ||
"default": "./lib/errors/index.js" | ||
}, | ||
@@ -37,0 +37,0 @@ "./package.json": "./package.json", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2897869
32898