@minatojs/driver-sqlite
Advanced tools
Comparing version 3.2.5 to 3.3.0
@@ -40,3 +40,3 @@ "use strict"; | ||
// minato/packages/sqlite/src/index.ts | ||
// packages/sqlite/src/index.ts | ||
var src_exports = {}; | ||
@@ -126,3 +126,3 @@ __export(src_exports, { | ||
__privateAdd(this, _create); | ||
this.sql = new SQLiteBuilder(database.tables); | ||
this.sql = new SQLiteBuilder(); | ||
} | ||
@@ -243,3 +243,3 @@ async prepare(table) { | ||
async get(sel) { | ||
const { tables } = sel; | ||
const { model, tables } = sel; | ||
const builder = new SQLiteBuilder(tables); | ||
@@ -250,14 +250,9 @@ const sql = builder.get(sel); | ||
const rows = __privateMethod(this, _all, all_fn).call(this, sql); | ||
return rows.map((row) => this.sql.load(sel.model, row)); | ||
return rows.map((row) => builder.load(model, row)); | ||
} | ||
async eval(sel, expr) { | ||
const output = this.sql.parseEval(expr); | ||
let sql = this.sql.get(sel.table); | ||
const prefix = `SELECT ${output} AS value `; | ||
if (sql.startsWith("SELECT * ")) { | ||
sql = prefix + sql.slice(9); | ||
} else { | ||
sql = `${prefix}FROM (${sql}) ${sql.ref}`; | ||
} | ||
const { value } = __privateMethod(this, _get, get_fn).call(this, sql); | ||
const builder = new SQLiteBuilder(sel.tables); | ||
const output = builder.parseEval(expr); | ||
const inner = builder.get(sel.table, true); | ||
const { value } = __privateMethod(this, _get, get_fn).call(this, `SELECT ${output} AS value FROM ${inner} ${sel.ref}`); | ||
return value; | ||
@@ -264,0 +259,0 @@ } |
{ | ||
"name": "@minatojs/driver-sqlite", | ||
"version": "3.2.5", | ||
"version": "3.3.0", | ||
"description": "SQLite Driver for Minato", | ||
@@ -28,9 +28,9 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"@minatojs/core": "^2.1.2" | ||
"@minatojs/core": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@minatojs/tests": "^1.3.1" | ||
"@minatojs/tests": "^1.4.0" | ||
}, | ||
"dependencies": { | ||
"@minatojs/sql-utils": "^3.0.1", | ||
"@minatojs/sql-utils": "^4.0.0", | ||
"@minatojs/sql.js": "^2.0.0", | ||
@@ -37,0 +37,0 @@ "cosmokit": "^1.4.0", |
Sorry, the diff of this file is not supported yet
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
38286
409
+ Added@minatojs/sql-utils@4.3.0(transitive)
- Removed@minatojs/sql-utils@3.0.1(transitive)
Updated@minatojs/sql-utils@^4.0.0