extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add debug logging to diagnose db.selectFrom error

+7 -2
+7 -2
src/lib/server/db.ts
··· 75 75 dialect: new SqliteDialect({ database: sqlite }), 76 76 }); 77 77 78 + console.log('[DB] Local database initialized:', typeof localDb, 'hasSelectFrom:', typeof localDb.selectFrom); 78 79 return localDb; 79 80 } 80 81 81 82 export function getDb(platform: App.Platform | undefined): Kysely<Database> { 82 83 // Production: Use Cloudflare D1 83 84 if (platform?.env?.DB) { 84 - return new Kysely<Database>({ 85 + const d1db = new Kysely<Database>({ 85 86 dialect: new D1Dialect({ database: platform.env.DB }), 86 87 }); 88 + console.log('[DB] Using Cloudflare D1, hasSelectFrom:', typeof d1db.selectFrom); 89 + return d1db; 87 90 } 88 91 89 92 // Local development: Use better-sqlite3 90 93 console.log('[DB] Using local SQLite database for development'); 91 - return initLocalDb(); 94 + const db = initLocalDb(); 95 + console.log('[DB] getDb returning:', typeof db, 'hasSelectFrom:', typeof db.selectFrom, 'keys:', Object.keys(db).slice(0, 5)); 96 + return db; 92 97 }