{"version":3,"file":"postgres.mjs","names":[],"sources":["../../src/db/postgres.ts"],"sourcesContent":["/**\n * PostgreSQL runtime adapter\n *\n * Creates a Kysely dialect for PostgreSQL via pg.\n * Loaded at runtime via virtual module.\n */\n\nimport type { PostgresDialect } from \"kysely\";\nimport { Pool } from \"pg\";\n\nimport { FailFastPostgresDialect } from \"../database/pg-migration-lock.js\";\nimport type { PostgresConfig } from \"./adapters.js\";\n\n/**\n * Create a PostgreSQL dialect from config\n */\nexport function createDialect(config: PostgresConfig): PostgresDialect {\n\tconst pool = new Pool({\n\t\tconnectionString: config.connectionString,\n\t\thost: config.host,\n\t\tport: config.port,\n\t\tdatabase: config.database,\n\t\tuser: config.user,\n\t\tpassword: config.password,\n\t\tssl: config.ssl,\n\t\tmin: config.pool?.min ?? 0,\n\t\tmax: config.pool?.max ?? 10,\n\t});\n\n\t// Fail-fast migration locking instead of Kysely's blocking advisory\n\t// lock — see pg-migration-lock.ts (#1744).\n\treturn new FailFastPostgresDialect({ pool });\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,cAAc,QAAyC;AAetE,QAAO,IAAI,wBAAwB,EAAE,MAdxB,IAAI,KAAK;EACrB,kBAAkB,OAAO;EACzB,MAAM,OAAO;EACb,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,KAAK,OAAO;EACZ,KAAK,OAAO,MAAM,OAAO;EACzB,KAAK,OAAO,MAAM,OAAO;EACzB,CAAC,EAIyC,CAAC"}