@atscript/db-sqlite 0.1.49 → 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 +4 -3
- package/dist/index.mjs +5 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -97,10 +97,11 @@ const sqliteDialect = {
|
|
|
97
97
|
return typeof value === "boolean" ? value ? 1 : 0 : value;
|
|
98
98
|
},
|
|
99
99
|
regex(quotedCol, value) {
|
|
100
|
-
const pattern =
|
|
100
|
+
const { pattern, flags } = (0, _atscript_db_sql_tools.parseRegexString)(value);
|
|
101
|
+
const likePattern = regexToLike(pattern);
|
|
101
102
|
return {
|
|
102
|
-
sql: `${quotedCol} LIKE ?`,
|
|
103
|
-
params: [
|
|
103
|
+
sql: flags.includes("i") ? `${quotedCol} LIKE ? COLLATE NOCASE` : `${quotedCol} LIKE ?`,
|
|
104
|
+
params: [likePattern]
|
|
104
105
|
};
|
|
105
106
|
},
|
|
106
107
|
createViewPrefix: "CREATE VIEW IF NOT EXISTS"
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
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/better-sqlite3-driver.ts
|
|
5
5
|
/**
|
|
6
6
|
* {@link TSqliteDriver} implementation backed by `better-sqlite3`.
|
|
@@ -96,10 +96,11 @@ const sqliteDialect = {
|
|
|
96
96
|
return typeof value === "boolean" ? value ? 1 : 0 : value;
|
|
97
97
|
},
|
|
98
98
|
regex(quotedCol, value) {
|
|
99
|
-
const pattern
|
|
99
|
+
const { pattern, flags } = parseRegexString(value);
|
|
100
|
+
const likePattern = regexToLike(pattern);
|
|
100
101
|
return {
|
|
101
|
-
sql: `${quotedCol} LIKE ?`,
|
|
102
|
-
params: [
|
|
102
|
+
sql: flags.includes("i") ? `${quotedCol} LIKE ? COLLATE NOCASE` : `${quotedCol} LIKE ?`,
|
|
103
|
+
params: [likePattern]
|
|
103
104
|
};
|
|
104
105
|
},
|
|
105
106
|
createViewPrefix: "CREATE VIEW IF NOT EXISTS"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db-sqlite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"description": "SQLite adapter for @atscript/db with swappable driver support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@atscript/typescript": "^0.1.47",
|
|
49
49
|
"@uniqu/core": "^0.1.4",
|
|
50
50
|
"better-sqlite3": ">=11.0.0",
|
|
51
|
-
"@atscript/db": "^0.1.
|
|
52
|
-
"@atscript/db-sql-tools": "^0.1.
|
|
51
|
+
"@atscript/db": "^0.1.50",
|
|
52
|
+
"@atscript/db-sql-tools": "^0.1.50"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"better-sqlite3": {
|