MCPcopy
hub / github.com/codedogQBY/ReadAny / configureDatabaseConnection

Function configureDatabaseConnection

packages/core/src/db/db-core.ts:82–103  ·  view source on GitHub ↗
(database: IDatabase)

Source from the content-addressed store, hash-verified

80}
81
82async function configureDatabaseConnection(database: IDatabase): Promise<void> {
83 try {
84 await database.execute("PRAGMA journal_mode = WAL");
85 } catch {
86 // Some adapters may not support WAL mode changes
87 }
88 try {
89 await database.execute("PRAGMA synchronous = NORMAL");
90 } catch {
91 // Some adapters may not support synchronous mode changes
92 }
93 try {
94 await database.execute("PRAGMA foreign_keys = ON");
95 } catch {
96 // Some adapters may not support PRAGMA configuration
97 }
98 try {
99 await database.execute("PRAGMA busy_timeout = 15000");
100 } catch {
101 // Some adapters may not support PRAGMA configuration
102 }
103}
104
105export async function cleanupOrphanedSyncRows(databaseArg?: IDatabase): Promise<void> {
106 const database = databaseArg ?? (await getDB());

Callers 2

getDBFunction · 0.85
getLocalDBFunction · 0.85

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected