Comparing version 2.10.0-beta.0 to 2.10.0-beta.1
{ | ||
"name": "leoric", | ||
"version": "2.10.0-beta.0", | ||
"version": "2.10.0-beta.1", | ||
"description": "JavaScript Object-relational mapping alchemy", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -388,2 +388,17 @@ 'use strict'; | ||
#emptySpell() { | ||
Object.assign(this, { | ||
columns: [], | ||
whereConditions: [], | ||
groups: [], | ||
orders: [], | ||
havingConditions: [], | ||
joins: {}, | ||
skip: 0, | ||
subqueryIndex: 0, | ||
rowCount: 0, | ||
skip: 0, | ||
}); | ||
} | ||
get unscoped() { | ||
@@ -794,2 +809,8 @@ const spell = this.dup; | ||
$with(...qualifiers) { | ||
if (this.rowCount > 0 || this.skip > 0) { | ||
const spell = this.dup; | ||
this.#emptySpell(); | ||
this.table = { type: 'subquery', value: spell }; | ||
} | ||
for (const qualifier of qualifiers) { | ||
@@ -796,0 +817,0 @@ if (isPlainObject(qualifier)) { |
361049
9956