eslint-plugin-slonik 1.5.0 → 1.6.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.
package/README.md CHANGED
@@ -178,7 +178,7 @@ targets: [
178
178
 
179
179
  ```bash
180
180
  pnpm add slonik zod
181
- pnpm add -D eslint-plugin-slonik @typescript-eslint/utils libpg-query
181
+ pnpm add -D eslint-plugin-slonik libpg-query
182
182
  ```
183
183
 
184
184
  ### 2. Create your SQL tag with type aliases
package/dist/index.cjs CHANGED
@@ -1119,6 +1119,11 @@ const zBaseSchema = z__default.object({
1119
1119
  * Whether or not keep the connection alive. Change it only if you know what you're doing.
1120
1120
  */
1121
1121
  keepAlive: z__default.boolean().optional(),
1122
+ /**
1123
+ * Connection timeout in milliseconds. If the connection is not established within this time,
1124
+ * an error will be thrown. Defaults to 5000 (5 seconds).
1125
+ */
1126
+ connectionTimeout: z__default.number().optional(),
1122
1127
  /**
1123
1128
  * Override defaults
1124
1129
  */
@@ -1281,14 +1286,23 @@ function reportCheck(params) {
1281
1286
  { _tag: "InvalidMigrationError" },
1282
1287
  { _tag: "InvalidMigrationsPathError" },
1283
1288
  { _tag: "DatabaseInitializationError" },
1284
- { _tag: "InternalError" },
1285
1289
  (error2) => {
1286
1290
  if (params.connection.keepAlive === true) {
1287
1291
  fatalError = error2;
1288
1292
  }
1289
1293
  return checkSql_utils.reportBaseError({ context, error: error2, tag });
1290
1294
  }
1291
- ).exhaustive();
1295
+ ).with({ _tag: "InternalError" }, (error2) => {
1296
+ const isConfigError = error2.message.includes("Invalid override column key");
1297
+ if (isConfigError) {
1298
+ return checkSql_utils.reportBaseError({ context, error: error2, tag });
1299
+ }
1300
+ console.warn(
1301
+ `[eslint-plugin-slonik] Skipping query due to unsupported SQL syntax: ${error2.message}
1302
+ If you believe this query should be supported, please open an issue at https://github.com/gajus/eslint-plugin-slonik/issues`
1303
+ );
1304
+ return;
1305
+ }).exhaustive();
1292
1306
  },
1293
1307
  ({ result, checker, parser }) => {
1294
1308
  if (result === null) {