mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Handling sessions, json response if not logged in
This commit is contained in:
parent
52ae2828e5
commit
4c2c617b96
7 changed files with 110 additions and 23 deletions
|
@ -5,7 +5,7 @@ module.exports = {
|
|||
GetDB,
|
||||
AddColumn,
|
||||
TableInfo,
|
||||
UpdateRecord,
|
||||
Update,
|
||||
Delete,
|
||||
CreateTable,
|
||||
SelectAll,
|
||||
|
@ -83,7 +83,7 @@ function TableInfo (db, table) {
|
|||
}
|
||||
}
|
||||
|
||||
function UpdateRecord (db, table, newData, conditions) {
|
||||
function Update (db, table, newData, conditions) {
|
||||
try {
|
||||
const s = `UPDATE ${table} SET ${GetSqlQuerry(newData)} WHERE ${GetSqlQuerry(conditions)}`
|
||||
DebugLog(s)
|
||||
|
@ -118,7 +118,8 @@ function CreateTable (db, name, columns) {
|
|||
return acc
|
||||
}, []).join(', ')
|
||||
|
||||
const s = `CREATE TABLE IF NOT EXISTS ${name}(${cols})`
|
||||
// IF NOT EXISTS // TODO
|
||||
const s = `CREATE TABLE ${name}(${cols})`
|
||||
DebugLog(s)
|
||||
|
||||
const stmt = db.prepare(s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue