[node] finished the great typescript rewrite
This commit is contained in:
parent
8107afbd90
commit
a1d6b03ec9
30 changed files with 1019 additions and 359 deletions
20
nodejs/database/surveys.ts
Normal file
20
nodejs/database/surveys.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { DbData, db } from './db.ts';
|
||||
|
||||
//const deleteExpiredSurveysStatement = db.prepare(`DELETE FROM surveys WHERE data->>'expiration' < ?;`);
|
||||
//const getSurveysStatement = db.prepare(`SELECT data FROM surveys WHERE data->>'symbol' = ?;`);
|
||||
//const setSurveysStatement = db.prepare(`INSERT INTO surveys(data) VALUES (json(?));`);
|
||||
//
|
||||
//export function deleteExpired() {
|
||||
// return deleteExpiredSurveysStatement.run(new Date().toISOString()).changes;
|
||||
//}
|
||||
//
|
||||
//export function get(symbol) {
|
||||
// deleteExpired();
|
||||
// const data = getSurveysStatement.all(symbol);
|
||||
// return data.map(elt => JSON.parse(elt.data));
|
||||
//}
|
||||
//
|
||||
//export function set(survey) {
|
||||
// deleteExpired();
|
||||
// return setSurveysStatement.run(JSON.stringify(survey));
|
||||
//}
|
Loading…
Add table
Add a link
Reference in a new issue