Versie 0.3.3
This commit is contained in:
1 parent
1cf6eeed29
commit
6e741a51fe
57 files changed
+1362
-2135
No files matched your search
+11
-1
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:95f28c26a77b79beac5f8c6818bd25243362641c1d8549949427a847e4f810f9
|
||||
// Generated, do not edit. sha256:232164f95c0eb5137f0c20ab218bdb9ffd81d26142889e12d2caf11dfbc181a3
|
||||
import { DatabaseSync } from 'node:sqlite';
|
||||
|
||||
export const BUSY_TIMEOUT_MS = 5000;
|
||||
@@ -30,6 +30,16 @@ export function withOtherDatabase(pad, fn) {
|
||||
}
|
||||
}
|
||||
|
||||
export function peekDatabase(pad, fn) {
|
||||
const peek = new DatabaseSync(pad, { readOnly: true });
|
||||
const all = (sql, params = []) => peek.prepare(sql).all(...bind(params)).map(rij => ({ ...rij }));
|
||||
try {
|
||||
return fn({ all, one: (sql, params = []) => all(sql, params)[0] ?? null });
|
||||
} finally {
|
||||
peek.close();
|
||||
}
|
||||
}
|
||||
|
||||
export function closeDatabase() {
|
||||
if (!db) return;
|
||||
db.close();
|
||||
|
||||
+5
-2
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:52135637bc4779b2b5f755ec50fedf41d2fa7b65d90a35f911c4e68f0b093874
|
||||
// Generated, do not edit. sha256:9946c137bb48925908ab17af61fbcdfb543a87d4be25e34812a95d4084af9425
|
||||
import { CONFIG, PREFERENCES, SOURCE_CAPABILITIES, SOURCE_ENDPOINTS, DASHBOARD } from '../../shared/config.js';
|
||||
import { toSearchName } from '../../shared/search-name.js';
|
||||
import { run, one, all, lastId } from './conn.mjs';
|
||||
@@ -176,7 +176,10 @@ export function seedDashboardProfile() {
|
||||
return true;
|
||||
}
|
||||
|
||||
const FRESH_VALUES = Object.freeze({ app: Object.freeze({ market_spot: 'first' }) });
|
||||
const FRESH_VALUES = Object.freeze({
|
||||
app: Object.freeze({ market_spot: 'first' }),
|
||||
ai: Object.freeze({ enabled: 0 }),
|
||||
});
|
||||
|
||||
export function seedPreferences() {
|
||||
for (const [scope, keys] of Object.entries(PREFERENCES)) {
|
||||
|
||||
Reference in new issue
Block a user