MCPcopy
hub / github.com/pickle-com/glass / createPreset

Function createPreset

src/features/settings/repositories/sqlite.repository.js:35–51  ·  view source on GitHub ↗
({ uid, title, prompt })

Source from the content-addressed store, hash-verified

33}
34
35function createPreset({ uid, title, prompt }) {
36 const db = sqliteClient.getDb();
37 const id = require('crypto').randomUUID();
38 const now = Math.floor(Date.now() / 1000);
39 const query = `
40 INSERT INTO prompt_presets (id, uid, title, prompt, is_default, created_at, sync_state)
41 VALUES (?, ?, ?, ?, 0, ?, 'dirty')
42 `;
43
44 try {
45 db.prepare(query).run(id, uid, title, prompt, now);
46 return { id };
47 } catch (err) {
48 console.error('SQLite: Failed to create preset:', err);
49 throw err;
50 }
51}
52
53function updatePreset(id, { title, prompt }, uid) {
54 const db = sqliteClient.getDb();

Callers

nothing calls this directly

Calls 1

getDbMethod · 0.80

Tested by

no test coverage detected