@atscript/db-postgres 0.1.48 → 0.1.50

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/dist/index.cjs CHANGED
@@ -60,9 +60,9 @@ const pgDialect = {
60
60
  return value;
61
61
  },
62
62
  regex(quotedCol, value) {
63
- const pattern = value instanceof RegExp ? value.source : String(value);
63
+ const { pattern, flags } = (0, _atscript_db_sql_tools.parseRegexString)(value);
64
64
  return {
65
- sql: `${quotedCol} ~ ?`,
65
+ sql: `${quotedCol} ${flags.includes("i") ? "~*" : "~"} ?`,
66
66
  params: [pattern]
67
67
  };
68
68
  },
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as PostgresPlugin } from "./plugin-C4tRUZGB.mjs";
2
2
  import { AtscriptDbView, BaseDbAdapter, DbError, DbSpace } from "@atscript/db";
3
- import { buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildInsert, buildSelect, buildUpdate, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, finalizeParams, refActionToSql } from "@atscript/db-sql-tools";
3
+ import { buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildInsert, buildSelect, buildUpdate, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, finalizeParams, parseRegexString, refActionToSql } from "@atscript/db-sql-tools";
4
4
  //#region src/sql-builder.ts
5
5
  /**
6
6
  * PostgreSQL-aware default value for a given design type.
@@ -59,9 +59,9 @@ const pgDialect = {
59
59
  return value;
60
60
  },
61
61
  regex(quotedCol, value) {
62
- const pattern = value instanceof RegExp ? value.source : String(value);
62
+ const { pattern, flags } = parseRegexString(value);
63
63
  return {
64
- sql: `${quotedCol} ~ ?`,
64
+ sql: `${quotedCol} ${flags.includes("i") ? "~*" : "~"} ?`,
65
65
  params: [pattern]
66
66
  };
67
67
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db-postgres",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "description": "PostgreSQL adapter for @atscript/db with pg (node-postgres) driver support.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -46,17 +46,17 @@
46
46
  "@atscript/core": "^0.1.47",
47
47
  "@atscript/typescript": "^0.1.47",
48
48
  "@types/pg": "^8.11.0",
49
- "@uniqu/core": "^0.1.3",
49
+ "@uniqu/core": "^0.1.4",
50
50
  "pg": "^8.13.0",
51
51
  "unplugin-atscript": "^0.1.47"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@atscript/core": "^0.1.47",
55
55
  "@atscript/typescript": "^0.1.47",
56
- "@uniqu/core": "^0.1.3",
56
+ "@uniqu/core": "^0.1.4",
57
57
  "pg": ">=8.0.0",
58
- "@atscript/db": "^0.1.48",
59
- "@atscript/db-sql-tools": "^0.1.48"
58
+ "@atscript/db-sql-tools": "^0.1.50",
59
+ "@atscript/db": "^0.1.50"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "pg": {