mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
Add embedded PGlite support as zero-config database option
Add @electric-sql/pglite so the server can run without an external Postgres instance. When DATABASE_URL is not set, the server auto-creates an embedded PGlite database in ./data/pglite with schema push on startup. - Add createPgliteDb() alongside the existing createDb() - Make DATABASE_URL optional in server config - Update drizzle config to glob schema files - Update migrate script to support both Postgres and PGlite - Add data/ to .gitignore for local PGlite storage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e4752d0092
commit
4bc8e8baa9
10 changed files with 76 additions and 326 deletions
|
|
@ -1,16 +1,13 @@
|
|||
export interface Config {
|
||||
port: number;
|
||||
databaseUrl: string;
|
||||
databaseUrl: string | undefined;
|
||||
serveUi: boolean;
|
||||
}
|
||||
|
||||
export function loadConfig(): Config {
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
if (!databaseUrl) throw new Error("DATABASE_URL is required");
|
||||
|
||||
return {
|
||||
port: Number(process.env.PORT) || 3100,
|
||||
databaseUrl,
|
||||
databaseUrl: process.env.DATABASE_URL,
|
||||
serveUi: process.env.SERVE_UI === "true",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue