Comparing version 1.6.2 to 1.6.3
@@ -0,1 +1,7 @@ | ||
1.6.3 / 2021-07-14 | ||
================== | ||
* fix: transaction option passing in sequelize adapter (#136) | ||
* fix: this.Model and proper Model.describe() (#135) | ||
1.6.2 / 2021-07-09 | ||
@@ -2,0 +8,0 @@ ================== |
{ | ||
"name": "leoric", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "JavaScript Object-relational mapping alchemy", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -286,5 +286,6 @@ 'use strict'; | ||
// static describe() { | ||
// throw new Error('unimplemented'); | ||
// } | ||
static async describe() { | ||
const { driver, physicTable: table } = this; | ||
return await driver.describeTable(table); | ||
} | ||
@@ -518,2 +519,3 @@ static async destroy(options = {}) { | ||
} | ||
// EXISTS | ||
@@ -672,2 +674,9 @@ // get isNewRecord() {} | ||
/** | ||
* An alias of instance constructor. Some legacy code access model name from instance with `this.Model.name`. | ||
*/ | ||
get Model() { | ||
return this.constructor; | ||
} | ||
/** | ||
* | ||
@@ -674,0 +683,0 @@ * |
@@ -32,2 +32,7 @@ 'use strict'; | ||
async describeTable(table) { | ||
const { escapeId } = this; | ||
await this.query(`DESCRIBE TABLE ${escapeId(table)}`); | ||
}, | ||
async addColumn(table, name, params) { | ||
@@ -34,0 +39,0 @@ const { escapeId, Attribute } = this; |
@@ -158,2 +158,6 @@ 'use strict'; | ||
async describeTable(table) { | ||
return await this.query(`PRAGMA table_info(${this.escapeId(table)})`); | ||
}, | ||
async addColumn(table, name, params) { | ||
@@ -160,0 +164,0 @@ const { escapeId } = this; |
@@ -536,2 +536,3 @@ 'use strict'; | ||
// transaction options is passed around in opts.transaction in sequelize adapter | ||
Object.assign(this, { | ||
@@ -548,3 +549,3 @@ command: 'select', | ||
subqueryIndex: 0 | ||
}, opts); | ||
}, opts.transaction, opts); | ||
@@ -551,0 +552,0 @@ const hints = []; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251260
7315