mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 21:26:33 +00:00
Removed redundant pg prefix — fields already nested under db:. pgHost→host, pgPort→port, pgDatabase→database, pgUser→user, pgPassword→password, pgPoolMax→poolMax, pgUrl→url. Updated all 3 plugin schemas, shared DbConfig type, init.ts, and sec-config template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
814 B
TypeScript
28 lines
814 B
TypeScript
import * as av from "@anyvali/js";
|
|
|
|
export const dbConfigSchema = av.object(
|
|
{
|
|
driver: av.enum_(["sqlite", "postgres"] as const).default("postgres"),
|
|
sqlitePath: av.string().minLength(1).default("/var/lib/betterframe/betterframe.db"),
|
|
url: av.string().default(""),
|
|
host: av.string().default("postgres"),
|
|
port: av.int().min(1).max(65535).default(5432),
|
|
database: av.string().default("betterframe"),
|
|
user: av.string().default("betterframe"),
|
|
password: av.string().default("betterframe"),
|
|
poolMax: av.int().min(1).max(1000).default(10),
|
|
},
|
|
{ unknownKeys: "strip" },
|
|
);
|
|
|
|
export type DbConfig = {
|
|
driver: "sqlite" | "postgres";
|
|
sqlitePath: string;
|
|
url: string;
|
|
host: string;
|
|
port: number;
|
|
database: string;
|
|
user: string;
|
|
password: string;
|
|
poolMax: number;
|
|
};
|