Checkpoint SHD dashboard design system

This commit is contained in:
JB
2026-07-24 21:31:35 -04:00
commit 5e113454ee
52 changed files with 3128 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { connect, type Database } from '@tursodatabase/database';
import { env } from '$env/dynamic/private';
import { resolve } from 'node:path';
let databasePromise: Promise<Database> | undefined;
/**
* Returns the process-wide embedded Turso connection.
*
* This module lives under $lib/server so SvelteKit prevents it from being
* imported into browser bundles.
*/
export function getDatabase(): Promise<Database> {
const configuredPath = env.TDR_DATABASE_PATH || './data/shd-build.db';
if (!databasePromise) {
databasePromise = connect(resolve(configuredPath));
}
return databasePromise;
}