mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 12:22:50 +02:00
Store invite
in database and sync power on startup
This commit is contained in:
parent
74632c671c
commit
df1296e579
8 changed files with 119 additions and 4 deletions
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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue