1
0
Fork 0

[node] finished the great typescript rewrite

This commit is contained in:
Julien Dessaux 2024-03-27 15:20:14 +01:00
parent 8107afbd90
commit a1d6b03ec9
Signed by: adyxax
GPG key ID: F92E51B86E07177E
30 changed files with 1019 additions and 359 deletions

View 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));
//}