/** * PGlite packages the upgraded orm.config.ts loads. Versions match the pinned * service-template-ts tag (see TEMPLATE_REFS in ./template.ts). */ export declare const PGLITE_DEPS: Record; /** src/orm.config.ts as the v1 template shipped it (no PGlite support). */ export declare const ORM_CONFIG_V1 = "import { ConfigModule, ConfigService } from '@nestjs/config';\nimport { DataSource } from 'typeorm';\nimport {\n TypeOrmModuleAsyncOptions,\n TypeOrmModuleOptions,\n} from '@nestjs/typeorm';\nimport { join } from 'path';\nimport AppConfig from './config';\n\nconst sslConfig = process.env.DB_SSL\n ? {\n ssl: true,\n extra: {\n ssl: {\n rejectUnauthorized: false,\n },\n },\n }\n : {};\n\nconst ormConfig = {\n type: AppConfig.database.type as any,\n host: AppConfig.database.host,\n port: parseInt(AppConfig.database.port, 10),\n username: AppConfig.database.username,\n database: AppConfig.database.database,\n password: AppConfig.database.password,\n schema: AppConfig.database.schema,\n entities: [join(__dirname, '**', '*.entity.js')],\n migrations: [join(__dirname, '**', 'migrations/*-migration.js')],\n synchronize: AppConfig.database.synchronize,\n logging: AppConfig.database.logging,\n ...sslConfig,\n};\n\nexport const typeOrmAsyncConfig: TypeOrmModuleAsyncOptions = {\n imports: [ConfigModule],\n inject: [ConfigService],\n useFactory: async (): Promise => {\n console.log('ORM CONFIG', ormConfig);\n return ormConfig;\n },\n};\n\nexport default new DataSource(ormConfig);\n"; /** * The v1 orm.config.ts with a PGlite branch for DATABASE_TYPE=pglite. Same * exports and same behavior for every other database type. */ export declare const ORM_CONFIG_V1_PGLITE = "import { ConfigModule, ConfigService } from '@nestjs/config';\nimport { DataSource } from 'typeorm';\nimport {\n TypeOrmModuleAsyncOptions,\n TypeOrmModuleOptions,\n} from '@nestjs/typeorm';\nimport { join } from 'path';\nimport AppConfig from './config';\n\n// DATABASE_TYPE=pglite runs on an in-process Postgres (PGlite) for local\n// checks: apso migrate verify, apso test smoke, and the in-browser editor.\n// PGLITE_DATA_DIR keeps the database on disk between commands.\nconst usePGlite = process.env.DATABASE_TYPE === 'pglite';\n\nconst sslConfig = process.env.DB_SSL\n ? {\n ssl: true,\n extra: {\n ssl: {\n rejectUnauthorized: false,\n },\n },\n }\n : {};\n\nconst ormConfig = {\n ...(usePGlite\n ? {\n type: 'postgres' as const,\n // Loaded only for PGlite so production installs never need it.\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n driver: new (require('typeorm-pglite').PGliteDriver)({\n dataDir: process.env.PGLITE_DATA_DIR,\n }).driver,\n }\n : {\n type: AppConfig.database.type as any,\n host: AppConfig.database.host,\n port: parseInt(AppConfig.database.port, 10),\n username: AppConfig.database.username,\n database: AppConfig.database.database,\n password: AppConfig.database.password,\n schema: AppConfig.database.schema,\n ...sslConfig,\n }),\n entities: [join(__dirname, '**', '*.entity.js')],\n migrations: [join(__dirname, '**', 'migrations/*-migration.js')],\n synchronize: AppConfig.database.synchronize,\n logging: AppConfig.database.logging,\n};\n\nexport const typeOrmAsyncConfig: TypeOrmModuleAsyncOptions = {\n imports: [ConfigModule],\n inject: [ConfigService],\n useFactory: async (): Promise => {\n console.log('ORM CONFIG', { ...ormConfig, driver: usePGlite ? '[PGliteDriver]' : undefined });\n return ormConfig;\n },\n};\n\nexport default new DataSource(ormConfig);\n"; /** * Give a v1-template project PGlite support so the pre-deploy checks (apso * migrate verify, apso test smoke) can run. Replaces src/orm.config.ts only * when it is still the stock v1 file, so a customized config is never * overwritten, and declares the PGlite packages. * * @param {string} projectDir - The service project root. * @returns {boolean} True when orm.config.ts was upgraded. */ export declare function upgradeOrmConfigForPglite(projectDir: string): boolean;