/** * Finding, or creating, `c15t-backend.config.ts`. * * This replaces a 481-line adapter picker, and the shrinkage is the point * rather than a tidy-up. c15t 2.x asked which of five ORM adapters you used, * then which provider that adapter supported, then assembled a matching * `adapter:` expression and worked out the packages to install. Three of those * five adapters had no working migrator at the end of it, so the command * printed schema code at you to apply yourself. * * 3.0 connects to the database directly. There is one question worth asking — * which engine — and the answer is one of three. All three migrate. */ import * as p from '@clack/prompts'; import type { CliContext } from '../../../context/types.js'; export declare const CONFIG_FILENAME = "c15t-backend.config.ts"; /** The engines c15t supports, and what each needs to connect. */ export declare const DIALECTS: { readonly mysql: { readonly driver: '@effect/sql-mysql2'; readonly envVar: 'DATABASE_URL'; readonly field: 'url'; readonly label: 'MySQL'; readonly placeholder: 'mysql://user:password@localhost:3306/c15t'; }; readonly postgres: { readonly driver: '@effect/sql-pg'; readonly envVar: 'DATABASE_URL'; readonly field: 'url'; readonly label: 'PostgreSQL'; readonly placeholder: 'postgres://user:password@localhost:5432/c15t'; }; readonly sqlite: { readonly driver: '@effect/sql-sqlite-node'; readonly envVar: 'DATABASE_PATH'; readonly field: 'filename'; readonly label: 'SQLite'; readonly placeholder: './c15t.db'; }; }; export type Dialect = keyof typeof DIALECTS; interface PromptDependencies { select: typeof p.select; isCancel: typeof p.isCancel; } export declare const pathExists: (filePath: string) => Promise; /** * The generated config file. * * The connection is read from the environment rather than written into a file * that lands in version control — a database URL carries credentials. The 2.x * templates did the same, for the same reason. */ export declare const buildConfig: (dialect: Dialect) => string; export interface EnsuredConfig { readonly path: string; /** Driver packages to install. Empty when the config already existed. */ readonly dependencies: string[]; } /** * Returns the path to the backend config, creating one if there is none. * * @returns `null` when the operator cancels. */ export declare const ensureBackendConfig: (context: CliContext, dependencies?: PromptDependencies) => Promise; export {};