Store invite
in database and sync power on startup
This commit is contained in:
11
db/orm.js
11
db/orm.js
@@ -44,6 +44,8 @@ class From {
|
||||
/** @private */
|
||||
this.cols = []
|
||||
/** @private */
|
||||
this.makeColsSafe = true
|
||||
/** @private */
|
||||
this.using = []
|
||||
/** @private */
|
||||
this.isPluck = false
|
||||
@@ -78,6 +80,12 @@ class From {
|
||||
return r
|
||||
}
|
||||
|
||||
selectUnsafe(...cols) {
|
||||
this.cols = cols
|
||||
this.makeColsSafe = false
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* @template {Col} Select
|
||||
* @param {Select} col
|
||||
@@ -112,7 +120,8 @@ class From {
|
||||
}
|
||||
|
||||
prepare() {
|
||||
let sql = `SELECT ${this.cols.map(k => `"${k}"`).join(", ")} FROM ${this.tables[0]} `
|
||||
if (this.makeColsSafe) this.cols = this.cols.map(k => `"${k}"`)
|
||||
let sql = `SELECT ${this.cols.join(", ")} FROM ${this.tables[0]} `
|
||||
for (let i = 1; i < this.tables.length; i++) {
|
||||
const table = this.tables[i]
|
||||
const col = this.using[i-1]
|
||||
|
Reference in New Issue
Block a user