Store invite in database and sync power on startup

This commit is contained in:
Cadence Ember 2024-08-26 01:34:46 +12:00
commit df1296e579
8 changed files with 119 additions and 4 deletions

View file

@ -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]