@gscdump/engine-sqlite 2.1.0 → 2.1.1
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/query-source.mjs +2 -1
- package/dist/r2-manifest-store.mjs +1 -2
- package/dist/runner.mjs +2 -1
- package/package.json +2 -2
package/dist/query-source.mjs
CHANGED
|
@@ -2,10 +2,11 @@ import { createSqliteResolverAdapter, sqliteResolverAdapter } from "./resolver-a
|
|
|
2
2
|
import { createSqlQuerySource } from "@gscdump/engine/source";
|
|
3
3
|
function createSqliteQuerySource(config) {
|
|
4
4
|
const { executor, siteId, regex } = config;
|
|
5
|
+
const adapter = regex === void 0 ? sqliteResolverAdapter : createSqliteResolverAdapter({ regex });
|
|
5
6
|
return createSqlQuerySource({
|
|
6
7
|
name: "sqlite",
|
|
7
8
|
kind: "local",
|
|
8
|
-
adapter
|
|
9
|
+
adapter,
|
|
9
10
|
execute: async (sql, params) => {
|
|
10
11
|
return (await executor(sql, params, "all")).rows;
|
|
11
12
|
},
|
|
@@ -40,14 +40,13 @@ const searchTypeOf = (s) => s === void 0 || s === "web" ? "" : s;
|
|
|
40
40
|
const LOCK_TTL_MS = 3e4;
|
|
41
41
|
const LOCK_ACQUIRE_TIMEOUT_MS = 5e3;
|
|
42
42
|
const LOCK_RETRY_MIN_MS = 25;
|
|
43
|
-
const LOCK_RETRY_MAX_MS = 150;
|
|
44
43
|
const D1_BATCH_LIMIT = 95;
|
|
45
44
|
const D1_IN_CLAUSE_CHUNK = 90;
|
|
46
45
|
function lockScopeKey(scope) {
|
|
47
46
|
return `${scope.userId}|${siteIdOf(scope.siteId)}|${scope.table}|${scope.partition}`;
|
|
48
47
|
}
|
|
49
48
|
function jitterDelay() {
|
|
50
|
-
return LOCK_RETRY_MIN_MS + Math.floor(Math.random() *
|
|
49
|
+
return LOCK_RETRY_MIN_MS + Math.floor(Math.random() * 125);
|
|
51
50
|
}
|
|
52
51
|
function tierMatchCond(target) {
|
|
53
52
|
const explicit = eq(r2Manifest.tier, target);
|
package/dist/runner.mjs
CHANGED
|
@@ -22,8 +22,9 @@ function createSqliteInsightRunner(opts) {
|
|
|
22
22
|
return r;
|
|
23
23
|
}) };
|
|
24
24
|
};
|
|
25
|
+
const relations = buildRelations(schemaOverride ?? schema, {});
|
|
25
26
|
return { db: drizzle(callback, {
|
|
26
|
-
relations
|
|
27
|
+
relations,
|
|
27
28
|
logger
|
|
28
29
|
}) };
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/engine-sqlite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "SQLite / D1 engine adapter for @gscdump/analysis — typed analytics over sqlite-proxy executors (Cloudflare D1, libsql).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"drizzle-orm": "1.0.0-rc.4"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@gscdump/engine": "^2.1.
|
|
47
|
+
"@gscdump/engine": "^2.1.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"drizzle-orm": "1.0.0-rc.4",
|