MCPcopy
hub / github.com/drizzle-team/drizzle-orm / callback

Function callback

integration-tests/tests/sqlite/sqlite-proxy.test.ts:68–81  ·  view source on GitHub ↗
(sql: string, params: any[], method: string)

Source from the content-addressed store, hash-verified

66 serverSimulator = new ServerSimulator(client);
67
68 const callback = async (sql: string, params: any[], method: string) => {
69 try {
70 const rows = await serverSimulator.query(sql, params, method);
71
72 if (rows.error !== undefined) {
73 throw new Error(rows.error);
74 }
75
76 return { rows: rows.data };
77 } catch (e: any) {
78 console.error('Error from sqlite proxy server:', e.response?.data ?? e.message);
79 throw e;
80 }
81 };
82 db = proxyDrizzle(callback);
83 cachedDb = proxyDrizzle(callback, { cache: new TestCache() });
84 dbGlobalCached = proxyDrizzle(callback, { cache: new TestGlobalCache() });

Callers 5

refineMethod · 0.85
migrateFunction · 0.85
migrateFunction · 0.85
migrateFunction · 0.85
migrateFunction · 0.85

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected