Replace PGlite with embedded-postgres and add startup banner
Switch from PGlite (WebAssembly) to embedded-postgres for zero-config local development — provides a real PostgreSQL server with full compatibility. Add startup banner with config summary on server boot. Improve server bootstrap with auto port detection, database creation, and migration on startup. Update DATABASE.md, DEVELOPING.md, and SPEC-implementation.md to reflect the change. Update CLI database check and prompts. Simplify OnboardingWizard database options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,23 +35,32 @@ export async function databaseCheck(config: PaperclipConfig): Promise<CheckResul
|
||||
}
|
||||
}
|
||||
|
||||
// PGlite mode — check data dir
|
||||
const dataDir = path.resolve(config.database.pgliteDataDir);
|
||||
if (!fs.existsSync(dataDir)) {
|
||||
if (config.database.mode === "embedded-postgres") {
|
||||
const dataDir = path.resolve(config.database.embeddedPostgresDataDir);
|
||||
if (!fs.existsSync(dataDir)) {
|
||||
return {
|
||||
name: "Database",
|
||||
status: "warn",
|
||||
message: `Embedded PostgreSQL data directory does not exist: ${dataDir}`,
|
||||
canRepair: true,
|
||||
repair: () => {
|
||||
fs.mkdirSync(dataDir, { recursive: true });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "Database",
|
||||
status: "warn",
|
||||
message: `PGlite data directory does not exist: ${dataDir}`,
|
||||
canRepair: true,
|
||||
repair: () => {
|
||||
fs.mkdirSync(dataDir, { recursive: true });
|
||||
},
|
||||
status: "pass",
|
||||
message: `Embedded PostgreSQL configured at ${dataDir} (port ${config.database.embeddedPostgresPort})`,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "Database",
|
||||
status: "pass",
|
||||
message: `PGlite data directory exists: ${dataDir}`,
|
||||
status: "fail",
|
||||
message: `Unknown database mode: ${String(config.database.mode)}`,
|
||||
canRepair: false,
|
||||
repairHint: "Run `paperclip configure --section database`",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user