Files
pangolin/server/db/sqlite/safeRead.ts
miloschwartz 58ac499f30 add safeRead
2026-02-21 16:38:51 -08:00

12 lines
284 B
TypeScript

import { db } from "./driver";
/**
* Runs a read query. For SQLite there is no replica/primary distinction,
* so the query is executed once against the database.
*/
export async function safeRead<T>(
query: (d: typeof db) => Promise<T>
): Promise<T> {
return query(db);
}