eslint-plugin-slonik 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { g as getOrSetFromMapWithEnabled, D as DuplicateColumnsError, i as isPostgresError, P as PostgresError, d as defaultTypesMap, a as groupBy, t as toCase, f as fmap, b as assertNever, n as normalizeIndent, c as getConnectionStrategyByRuleOptionConnection, p as parseConnection, m as mapConnectionOptionsToString, e as getMigrationDatabaseMetadata, h as getDatabaseName, j as DEFAULT_CONNECTION_URL, k as isWatchMigrationsDirEnabled, l as initDatabase, r as runMigrations, I as InternalError } from '../shared/eslint-plugin-slonik.C0xTyWZ2.mjs';
1
+ import { g as getOrSetFromMapWithEnabled, D as DuplicateColumnsError, i as isPostgresError, P as PostgresError, d as defaultTypesMap, a as groupBy, t as toCase, f as fmap, b as assertNever, n as normalizeIndent, c as getConnectionStrategyByRuleOptionConnection, p as parseConnection, m as mapConnectionOptionsToString, e as getMigrationDatabaseMetadata, h as getDatabaseName, j as DEFAULT_CONNECTION_URL, k as isWatchMigrationsDirEnabled, l as initDatabase, r as runMigrations, I as InternalError } from '../shared/eslint-plugin-slonik.BqlRHJaM.mjs';
2
2
  import { either } from 'fp-ts';
3
3
  import * as parser from 'libpg-query';
4
4
  import path from 'path';
@@ -2275,7 +2275,15 @@ function getOrCreateConnection(databaseUrl, connectionMap, options) {
2275
2275
  O.fromNullable(connectionMap.get(databaseUrl)),
2276
2276
  O.foldW(
2277
2277
  () => {
2278
- const sql = postgres(databaseUrl, options);
2278
+ const config = parseConnection(databaseUrl);
2279
+ const sql = postgres({
2280
+ host: config.host,
2281
+ port: config.port,
2282
+ user: config.user,
2283
+ password: config.password,
2284
+ database: config.database,
2285
+ ...options
2286
+ });
2279
2287
  connectionMap.set(databaseUrl, sql);
2280
2288
  return { sql, databaseUrl, isFirst: true };
2281
2289
  },