@atscript/db-mysql 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
@@ -34,7 +34,7 @@ const mysqlDialect = {
34
34
  return typeof value === "boolean" ? value ? 1 : 0 : value;
35
35
  },
36
36
  regex(quotedCol, value) {
37
- const pattern = value instanceof RegExp ? value.source : String(value);
37
+ const { pattern } = (0, _atscript_db_sql_tools.parseRegexString)(value);
38
38
  return {
39
39
  sql: `${quotedCol} REGEXP ?`,
40
40
  params: [pattern]
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as MysqlPlugin } from "./plugin-3jLlPI4f.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, refActionToSql, toSqlValue } from "@atscript/db-sql-tools";
3
+ import { buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildInsert, buildSelect, buildUpdate, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, parseRegexString, refActionToSql, toSqlValue } from "@atscript/db-sql-tools";
4
4
  //#region src/sql-builder.ts
5
5
  /** Escapes a MySQL identifier by doubling backticks. */
6
6
  function esc(name) {
@@ -33,7 +33,7 @@ const mysqlDialect = {
33
33
  return typeof value === "boolean" ? value ? 1 : 0 : value;
34
34
  },
35
35
  regex(quotedCol, value) {
36
- const pattern = value instanceof RegExp ? value.source : String(value);
36
+ const { pattern } = parseRegexString(value);
37
37
  return {
38
38
  sql: `${quotedCol} REGEXP ?`,
39
39
  params: [pattern]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db-mysql",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "description": "MySQL adapter for @atscript/db with mysql2 driver support.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -43,17 +43,17 @@
43
43
  "devDependencies": {
44
44
  "@atscript/core": "^0.1.47",
45
45
  "@atscript/typescript": "^0.1.47",
46
- "@uniqu/core": "^0.1.3",
46
+ "@uniqu/core": "^0.1.4",
47
47
  "mysql2": "^3.11.0",
48
48
  "unplugin-atscript": "^0.1.47"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@atscript/core": "^0.1.47",
52
52
  "@atscript/typescript": "^0.1.47",
53
- "@uniqu/core": "^0.1.3",
53
+ "@uniqu/core": "^0.1.4",
54
54
  "mysql2": ">=3.0.0",
55
- "@atscript/db": "^0.1.48",
56
- "@atscript/db-sql-tools": "^0.1.48"
55
+ "@atscript/db": "^0.1.50",
56
+ "@atscript/db-sql-tools": "^0.1.50"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "mysql2": {