@gscdump/engine-sqlite 0.40.1 → 1.0.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 +3 -3
- package/dist/index.d.mts +9 -25
- package/dist/index.mjs +13 -124
- package/package.json +3 -8
- package/dist/r2-manifest-schema.d.mts +0 -775
- package/dist/r2-manifest-schema.mjs +0 -81
package/README.md
CHANGED
|
@@ -46,9 +46,9 @@ const rows = await executor(compiledSql, params) // queryUserD1, libsql, ...
|
|
|
46
46
|
### Engine source for analyzer dispatch
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
|
-
import {
|
|
49
|
+
import { createSqliteQuerySource } from '@gscdump/engine-sqlite'
|
|
50
50
|
|
|
51
|
-
const source =
|
|
51
|
+
const source = createSqliteQuerySource({
|
|
52
52
|
executor, // (sql, params, mode) => { rows }
|
|
53
53
|
siteId,
|
|
54
54
|
regex: true, // hosts that expose REGEXP (D1, libsql, sqlite3+regexp)
|
|
@@ -59,7 +59,7 @@ Always import `sql` from `@gscdump/engine-sqlite` — not `drizzle-orm` directly
|
|
|
59
59
|
|
|
60
60
|
## Exports
|
|
61
61
|
|
|
62
|
-
- `
|
|
62
|
+
- `createSqliteQuerySource({ executor, siteId, regex? })` — builds an `AnalysisQuerySource`.
|
|
63
63
|
- `createSqliteInsightRunner({ executor })` — sqlite-proxy drizzle adapter.
|
|
64
64
|
- `compileSqlite(sql)` — compile to `{ sql, params }` for any HTTP executor.
|
|
65
65
|
- `aggClicks` / `aggImpressions` / `aggCtr` / `aggPosition` — aggregate helpers.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
+
import { SQL, SQL as SQL$1, and, eq, gte, lte, sql } from "drizzle-orm";
|
|
1
2
|
import { AnalysisQuerySource } from "@gscdump/engine/source";
|
|
2
3
|
import { ResolverAdapter } from "@gscdump/engine/resolver";
|
|
3
|
-
import { SQL, SQL as SQL$1, and, eq, gte, lte, sql } from "drizzle-orm";
|
|
4
4
|
import { ScopedRunnerOptions, TableScope } from "@gscdump/engine/scope";
|
|
5
5
|
import { SqliteRemoteDatabase } from "drizzle-orm/sqlite-proxy";
|
|
6
6
|
import { ManifestStore } from "@gscdump/engine";
|
|
7
7
|
import { ComparisonMode, ResolveWindowOptions, ResolvedWindow, WindowPreset, resolveWindow } from "@gscdump/engine/period";
|
|
8
8
|
import { DrizzleD1Database } from "drizzle-orm/d1";
|
|
9
|
-
interface CachedManifestStoreOptions {
|
|
10
|
-
ttlMs?: number;
|
|
11
|
-
}
|
|
12
|
-
interface CachedManifestStore extends ManifestStore {
|
|
13
|
-
bust: (scope: {
|
|
14
|
-
userId: string | number;
|
|
15
|
-
siteId?: string;
|
|
16
|
-
table?: string;
|
|
17
|
-
searchType?: string;
|
|
18
|
-
}) => void;
|
|
19
|
-
clear: () => void;
|
|
20
|
-
stats: () => {
|
|
21
|
-
size: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
declare function createCachedManifestStore(inner: ManifestStore, options?: CachedManifestStoreOptions): CachedManifestStore;
|
|
25
9
|
/**
|
|
26
10
|
* Drizzle sqlite-core table definitions for the GSC analytics schema on D1.
|
|
27
11
|
*
|
|
@@ -3563,6 +3547,11 @@ declare const schema: {
|
|
|
3563
3547
|
}>;
|
|
3564
3548
|
};
|
|
3565
3549
|
type Schema = typeof schema;
|
|
3550
|
+
type MetricTable = typeof gsc_pages | typeof gsc_keywords | typeof gsc_countries | typeof gsc_devices | typeof gsc_page_keywords;
|
|
3551
|
+
declare function aggClicks(t: MetricTable): SQL$1;
|
|
3552
|
+
declare function aggImpressions(t: MetricTable): SQL$1;
|
|
3553
|
+
declare function aggCtr(t: MetricTable): SQL$1;
|
|
3554
|
+
declare function aggPosition(t: MetricTable): SQL$1;
|
|
3566
3555
|
declare function compileSqlite(query: SQL$1): {
|
|
3567
3556
|
sql: string;
|
|
3568
3557
|
params: unknown[];
|
|
@@ -3601,18 +3590,13 @@ declare function createSqliteInsightRunner<TSchema extends Record<string, unknow
|
|
|
3601
3590
|
*/
|
|
3602
3591
|
declare const scopeFor: (table: "gsc_pages" | "gsc_keywords" | "gsc_countries" | "gsc_devices" | "gsc_page_keywords" | "gsc_search_appearance" | "gsc_search_appearance_pages" | "gsc_search_appearance_queries" | "gsc_search_appearance_page_queries" | "gsc_query_dim" | "gsc_hourly_pages", opts: ScopedRunnerOptions) => TableScope, mergeScope: typeof import("@gscdump/engine/scope").mergeScope;
|
|
3603
3592
|
type SqliteQueryExecutor = SqliteRowExecutor;
|
|
3604
|
-
interface
|
|
3593
|
+
interface SqliteQuerySourceOptions {
|
|
3605
3594
|
executor: SqliteQueryExecutor;
|
|
3606
3595
|
siteId: string | number;
|
|
3607
3596
|
/** Override for hosts that expose REGEXP (D1, libsql, sqlite3+regexp). */
|
|
3608
3597
|
regex?: boolean;
|
|
3609
3598
|
}
|
|
3610
|
-
declare function
|
|
3611
|
-
type MetricTable = typeof gsc_pages | typeof gsc_keywords | typeof gsc_countries | typeof gsc_devices | typeof gsc_page_keywords;
|
|
3612
|
-
declare function aggClicks(t: MetricTable): SQL$1;
|
|
3613
|
-
declare function aggImpressions(t: MetricTable): SQL$1;
|
|
3614
|
-
declare function aggCtr(t: MetricTable): SQL$1;
|
|
3615
|
-
declare function aggPosition(t: MetricTable): SQL$1;
|
|
3599
|
+
declare function createSqliteQuerySource(config: SqliteQuerySourceOptions): AnalysisQuerySource;
|
|
3616
3600
|
declare const r2Manifest: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
3617
3601
|
name: "r2_manifest";
|
|
3618
3602
|
schema: undefined;
|
|
@@ -4417,4 +4401,4 @@ interface CreateSqliteResolverAdapterFromExecutorOptions {
|
|
|
4417
4401
|
* an executor handy.
|
|
4418
4402
|
*/
|
|
4419
4403
|
declare function createSqliteResolverAdapterFromExecutor(options: CreateSqliteResolverAdapterFromExecutorOptions): Promise<ResolverAdapter<TableKey>>;
|
|
4420
|
-
export { type AnalyticsManifestDb, type
|
|
4404
|
+
export { type AnalyticsManifestDb, type ComparisonMode, type R2LockInsert, type R2LockSelect, type R2ManifestInsert, type R2ManifestSelect, type R2ShadowDiffInsert, type R2ShadowDiffSelect, type R2SyncStateInsert, type R2SyncStateSelect, type R2WatermarkInsert, type R2WatermarkSelect, type R2WriteErrorInsert, type R2WriteErrorSelect, type ResolveWindowOptions, type ResolvedWindow, type SQL, type Schema, type ScopedRunnerOptions, type SqliteInsightRunner, type SqliteInsightRunnerOptions, type SqliteQueryExecutor, type SqliteQuerySourceOptions, type SqliteRowExecutor, type TableKey, type TableScope, type WindowPreset, aggClicks, aggCtr, aggImpressions, aggPosition, and, compileSqlite, createD1ManifestStore, createSqliteInsightRunner, createSqliteQuerySource, createSqliteResolverAdapter, createSqliteResolverAdapterFromExecutor, eq, gsc_countries, gsc_devices, gsc_keywords, gsc_page_keywords, gsc_pages, gsc_query_dim, gte, lte, mergeScope, probeSqliteRegex, r2Locks, r2Manifest, r2ShadowDiffs, r2SyncStates, r2Watermarks, r2WriteErrors, resolveWindow, schema, scopeFor, sql, sqliteResolverAdapter };
|
package/dist/index.mjs
CHANGED
|
@@ -1,122 +1,23 @@
|
|
|
1
|
+
import { and, and as and$1, eq, eq as eq$1, gte, inArray, isNotNull, isNull, lt, lte, lte as lte$1, or, sql, sql as sql$1 } from "drizzle-orm";
|
|
1
2
|
import { createSqlQuerySource } from "@gscdump/engine/source";
|
|
2
3
|
import { assertSchemaInSync, createResolverAdapter } from "@gscdump/engine/resolver";
|
|
3
|
-
import { and, and as and$1, eq, eq as eq$1, gte, inArray, isNotNull, isNull, lt, lte, lte as lte$1, or, sql, sql as sql$1 } from "drizzle-orm";
|
|
4
4
|
import { createScopedHelpers } from "@gscdump/engine/scope";
|
|
5
5
|
import { SQLiteAsyncDialect, index, integer, primaryKey, real, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
|
|
6
6
|
import { drizzle } from "drizzle-orm/sqlite-proxy";
|
|
7
7
|
import { inferSearchType } from "@gscdump/engine";
|
|
8
8
|
import { engineErrorToException, engineErrors } from "@gscdump/engine/errors";
|
|
9
9
|
import { resolveWindow } from "@gscdump/engine/period";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!filter.siteId || !filter.table || filter.partitions || filter.tier) return null;
|
|
13
|
-
const st = filter.searchType ?? "";
|
|
14
|
-
return `${filter.userId}\0${filter.siteId}\0${filter.table}\0${st}`;
|
|
10
|
+
function aggClicks(t) {
|
|
11
|
+
return sql$1`SUM(${t.clicks})`;
|
|
15
12
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
function bust(scope) {
|
|
26
|
-
generation++;
|
|
27
|
-
const userId = String(scope.userId);
|
|
28
|
-
if (scope.siteId && scope.table && scope.searchType !== void 0) {
|
|
29
|
-
invalidateKey(`${userId}\0${scope.siteId}\0${scope.table}\0${scope.searchType}`);
|
|
30
|
-
invalidateKey(`${userId}\0${scope.siteId}\0${scope.table}\0`);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const prefix = scope.siteId && scope.table ? `${userId}\0${scope.siteId}\0${scope.table}\0` : scope.siteId ? `${userId}\0${scope.siteId}\0` : `${userId}\0`;
|
|
34
|
-
for (const key of /* @__PURE__ */ new Set([...cache.keys(), ...inflight.keys()])) if (key.startsWith(prefix)) invalidateKey(key);
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
listLive: async (filter) => {
|
|
38
|
-
const k = cacheKey(filter);
|
|
39
|
-
if (!k) return inner.listLive(filter);
|
|
40
|
-
const now = Date.now();
|
|
41
|
-
const hit = cache.get(k);
|
|
42
|
-
if (hit && hit.expiresAt > now) return hit.value;
|
|
43
|
-
const pending = inflight.get(k);
|
|
44
|
-
if (pending) return pending;
|
|
45
|
-
const loadGeneration = generation;
|
|
46
|
-
const load = inner.listLive(filter).then((value) => {
|
|
47
|
-
if (generation === loadGeneration && inflight.get(k) === load) cache.set(k, {
|
|
48
|
-
value,
|
|
49
|
-
expiresAt: Date.now() + ttlMs
|
|
50
|
-
});
|
|
51
|
-
return value;
|
|
52
|
-
}).finally(() => {
|
|
53
|
-
if (inflight.get(k) === load) inflight.delete(k);
|
|
54
|
-
});
|
|
55
|
-
inflight.set(k, load);
|
|
56
|
-
return load;
|
|
57
|
-
},
|
|
58
|
-
listAll: inner.listAll.bind(inner),
|
|
59
|
-
registerVersion: async (entry, superseding) => {
|
|
60
|
-
await inner.registerVersion(entry, superseding);
|
|
61
|
-
bust({
|
|
62
|
-
userId: entry.userId,
|
|
63
|
-
siteId: entry.siteId ?? "",
|
|
64
|
-
table: entry.table,
|
|
65
|
-
searchType: entry.searchType
|
|
66
|
-
});
|
|
67
|
-
for (const e of superseding ?? []) bust({
|
|
68
|
-
userId: e.userId,
|
|
69
|
-
siteId: e.siteId ?? "",
|
|
70
|
-
table: e.table,
|
|
71
|
-
searchType: e.searchType
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
registerVersions: async (entries, superseding) => {
|
|
75
|
-
await inner.registerVersions(entries, superseding);
|
|
76
|
-
for (const e of entries) bust({
|
|
77
|
-
userId: e.userId,
|
|
78
|
-
siteId: e.siteId ?? "",
|
|
79
|
-
table: e.table,
|
|
80
|
-
searchType: e.searchType
|
|
81
|
-
});
|
|
82
|
-
for (const e of superseding ?? []) bust({
|
|
83
|
-
userId: e.userId,
|
|
84
|
-
siteId: e.siteId ?? "",
|
|
85
|
-
table: e.table,
|
|
86
|
-
searchType: e.searchType
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
listRetired: inner.listRetired.bind(inner),
|
|
90
|
-
delete: async (entries) => {
|
|
91
|
-
await inner.delete(entries);
|
|
92
|
-
for (const e of entries) bust({
|
|
93
|
-
userId: e.userId,
|
|
94
|
-
siteId: e.siteId ?? "",
|
|
95
|
-
table: e.table,
|
|
96
|
-
searchType: e.searchType
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
getWatermarks: inner.getWatermarks.bind(inner),
|
|
100
|
-
bumpWatermark: inner.bumpWatermark.bind(inner),
|
|
101
|
-
getSyncStates: inner.getSyncStates.bind(inner),
|
|
102
|
-
setSyncState: inner.setSyncState.bind(inner),
|
|
103
|
-
withLock: inner.withLock.bind(inner),
|
|
104
|
-
purgeTenant: async (filter) => {
|
|
105
|
-
const result = await inner.purgeTenant(filter);
|
|
106
|
-
bust({
|
|
107
|
-
userId: filter.userId,
|
|
108
|
-
siteId: filter.siteId
|
|
109
|
-
});
|
|
110
|
-
return result;
|
|
111
|
-
},
|
|
112
|
-
bust,
|
|
113
|
-
clear: () => {
|
|
114
|
-
generation++;
|
|
115
|
-
cache.clear();
|
|
116
|
-
inflight.clear();
|
|
117
|
-
},
|
|
118
|
-
stats: () => ({ size: cache.size })
|
|
119
|
-
};
|
|
13
|
+
function aggImpressions(t) {
|
|
14
|
+
return sql$1`SUM(${t.impressions})`;
|
|
15
|
+
}
|
|
16
|
+
function aggCtr(t) {
|
|
17
|
+
return sql$1`CAST(SUM(${t.clicks}) AS REAL) / NULLIF(SUM(${t.impressions}), 0)`;
|
|
18
|
+
}
|
|
19
|
+
function aggPosition(t) {
|
|
20
|
+
return sql$1`SUM(${t.sum_position}) / NULLIF(SUM(${t.impressions}), 0) + 1`;
|
|
120
21
|
}
|
|
121
22
|
function metricCols() {
|
|
122
23
|
return {
|
|
@@ -292,7 +193,7 @@ async function probeSqliteRegex(executor) {
|
|
|
292
193
|
async function createSqliteResolverAdapterFromExecutor(options) {
|
|
293
194
|
return createSqliteResolverAdapter({ regex: await probeSqliteRegex(options.executor) });
|
|
294
195
|
}
|
|
295
|
-
function
|
|
196
|
+
function createSqliteQuerySource(config) {
|
|
296
197
|
const { executor, siteId, regex } = config;
|
|
297
198
|
return createSqlQuerySource({
|
|
298
199
|
name: "sqlite",
|
|
@@ -304,18 +205,6 @@ function createEngine(config) {
|
|
|
304
205
|
siteId
|
|
305
206
|
});
|
|
306
207
|
}
|
|
307
|
-
function aggClicks(t) {
|
|
308
|
-
return sql$1`SUM(${t.clicks})`;
|
|
309
|
-
}
|
|
310
|
-
function aggImpressions(t) {
|
|
311
|
-
return sql$1`SUM(${t.impressions})`;
|
|
312
|
-
}
|
|
313
|
-
function aggCtr(t) {
|
|
314
|
-
return sql$1`CAST(SUM(${t.clicks}) AS REAL) / NULLIF(SUM(${t.impressions}), 0)`;
|
|
315
|
-
}
|
|
316
|
-
function aggPosition(t) {
|
|
317
|
-
return sql$1`SUM(${t.sum_position}) / NULLIF(SUM(${t.impressions}), 0) + 1`;
|
|
318
|
-
}
|
|
319
208
|
const r2Manifest = sqliteTable("r2_manifest", {
|
|
320
209
|
id: text("id").primaryKey(),
|
|
321
210
|
userId: integer("user_id").notNull(),
|
|
@@ -671,4 +560,4 @@ function createD1ManifestStore(db) {
|
|
|
671
560
|
purgeTenant
|
|
672
561
|
};
|
|
673
562
|
}
|
|
674
|
-
export { aggClicks, aggCtr, aggImpressions, aggPosition, and, compileSqlite,
|
|
563
|
+
export { aggClicks, aggCtr, aggImpressions, aggPosition, and, compileSqlite, createD1ManifestStore, createSqliteInsightRunner, createSqliteQuerySource, createSqliteResolverAdapter, createSqliteResolverAdapterFromExecutor, eq, gsc_countries, gsc_devices, gsc_keywords, gsc_page_keywords, gsc_pages, gsc_query_dim, gte, lte, mergeScope, probeSqliteRegex, r2Locks, r2Manifest, r2ShadowDiffs, r2SyncStates, r2Watermarks, r2WriteErrors, resolveWindow, schema, scopeFor, sql, sqliteResolverAdapter };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/engine-sqlite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
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",
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"types": "./dist/index.d.mts",
|
|
26
26
|
"import": "./dist/index.mjs",
|
|
27
27
|
"default": "./dist/index.mjs"
|
|
28
|
-
},
|
|
29
|
-
"./r2-manifest-schema": {
|
|
30
|
-
"types": "./dist/r2-manifest-schema.d.mts",
|
|
31
|
-
"import": "./dist/r2-manifest-schema.mjs",
|
|
32
|
-
"default": "./dist/r2-manifest-schema.mjs"
|
|
33
28
|
}
|
|
34
29
|
},
|
|
35
30
|
"main": "./dist/index.mjs",
|
|
@@ -38,13 +33,13 @@
|
|
|
38
33
|
"dist"
|
|
39
34
|
],
|
|
40
35
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
36
|
+
"node": ">=22"
|
|
42
37
|
},
|
|
43
38
|
"peerDependencies": {
|
|
44
39
|
"drizzle-orm": "1.0.0-rc.3"
|
|
45
40
|
},
|
|
46
41
|
"dependencies": {
|
|
47
|
-
"@gscdump/engine": "0.
|
|
42
|
+
"@gscdump/engine": "^1.0.0"
|
|
48
43
|
},
|
|
49
44
|
"devDependencies": {
|
|
50
45
|
"drizzle-orm": "1.0.0-rc.3",
|
|
@@ -1,775 +0,0 @@
|
|
|
1
|
-
declare const r2Manifest: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
-
name: "r2_manifest";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
-
name: string;
|
|
7
|
-
tableName: "r2_manifest";
|
|
8
|
-
dataType: "string";
|
|
9
|
-
data: string;
|
|
10
|
-
driverParam: string;
|
|
11
|
-
notNull: true;
|
|
12
|
-
hasDefault: false;
|
|
13
|
-
isPrimaryKey: true;
|
|
14
|
-
isAutoincrement: false;
|
|
15
|
-
hasRuntimeDefault: false;
|
|
16
|
-
enumValues: [string, ...string[]];
|
|
17
|
-
baseColumn: never;
|
|
18
|
-
identity: undefined;
|
|
19
|
-
generated: undefined;
|
|
20
|
-
}, {}>;
|
|
21
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
22
|
-
name: string;
|
|
23
|
-
tableName: "r2_manifest";
|
|
24
|
-
dataType: "number int53";
|
|
25
|
-
data: number;
|
|
26
|
-
driverParam: number;
|
|
27
|
-
notNull: true;
|
|
28
|
-
hasDefault: false;
|
|
29
|
-
isPrimaryKey: false;
|
|
30
|
-
isAutoincrement: false;
|
|
31
|
-
hasRuntimeDefault: false;
|
|
32
|
-
enumValues: undefined;
|
|
33
|
-
baseColumn: never;
|
|
34
|
-
identity: undefined;
|
|
35
|
-
generated: undefined;
|
|
36
|
-
}, {}>;
|
|
37
|
-
siteId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
38
|
-
name: string;
|
|
39
|
-
tableName: "r2_manifest";
|
|
40
|
-
dataType: "string";
|
|
41
|
-
data: string;
|
|
42
|
-
driverParam: string;
|
|
43
|
-
notNull: false;
|
|
44
|
-
hasDefault: false;
|
|
45
|
-
isPrimaryKey: false;
|
|
46
|
-
isAutoincrement: false;
|
|
47
|
-
hasRuntimeDefault: false;
|
|
48
|
-
enumValues: [string, ...string[]];
|
|
49
|
-
baseColumn: never;
|
|
50
|
-
identity: undefined;
|
|
51
|
-
generated: undefined;
|
|
52
|
-
}, {}>;
|
|
53
|
-
table: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
54
|
-
name: string;
|
|
55
|
-
tableName: "r2_manifest";
|
|
56
|
-
dataType: "string";
|
|
57
|
-
data: string;
|
|
58
|
-
driverParam: string;
|
|
59
|
-
notNull: true;
|
|
60
|
-
hasDefault: false;
|
|
61
|
-
isPrimaryKey: false;
|
|
62
|
-
isAutoincrement: false;
|
|
63
|
-
hasRuntimeDefault: false;
|
|
64
|
-
enumValues: [string, ...string[]];
|
|
65
|
-
baseColumn: never;
|
|
66
|
-
identity: undefined;
|
|
67
|
-
generated: undefined;
|
|
68
|
-
}, {}>;
|
|
69
|
-
partition: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
70
|
-
name: string;
|
|
71
|
-
tableName: "r2_manifest";
|
|
72
|
-
dataType: "string";
|
|
73
|
-
data: string;
|
|
74
|
-
driverParam: string;
|
|
75
|
-
notNull: true;
|
|
76
|
-
hasDefault: false;
|
|
77
|
-
isPrimaryKey: false;
|
|
78
|
-
isAutoincrement: false;
|
|
79
|
-
hasRuntimeDefault: false;
|
|
80
|
-
enumValues: [string, ...string[]];
|
|
81
|
-
baseColumn: never;
|
|
82
|
-
identity: undefined;
|
|
83
|
-
generated: undefined;
|
|
84
|
-
}, {}>;
|
|
85
|
-
objectKey: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
86
|
-
name: string;
|
|
87
|
-
tableName: "r2_manifest";
|
|
88
|
-
dataType: "string";
|
|
89
|
-
data: string;
|
|
90
|
-
driverParam: string;
|
|
91
|
-
notNull: true;
|
|
92
|
-
hasDefault: false;
|
|
93
|
-
isPrimaryKey: false;
|
|
94
|
-
isAutoincrement: false;
|
|
95
|
-
hasRuntimeDefault: false;
|
|
96
|
-
enumValues: [string, ...string[]];
|
|
97
|
-
baseColumn: never;
|
|
98
|
-
identity: undefined;
|
|
99
|
-
generated: undefined;
|
|
100
|
-
}, {}>;
|
|
101
|
-
rowCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
102
|
-
name: string;
|
|
103
|
-
tableName: "r2_manifest";
|
|
104
|
-
dataType: "number int53";
|
|
105
|
-
data: number;
|
|
106
|
-
driverParam: number;
|
|
107
|
-
notNull: true;
|
|
108
|
-
hasDefault: true;
|
|
109
|
-
isPrimaryKey: false;
|
|
110
|
-
isAutoincrement: false;
|
|
111
|
-
hasRuntimeDefault: false;
|
|
112
|
-
enumValues: undefined;
|
|
113
|
-
baseColumn: never;
|
|
114
|
-
identity: undefined;
|
|
115
|
-
generated: undefined;
|
|
116
|
-
}, {}>;
|
|
117
|
-
bytes: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
118
|
-
name: string;
|
|
119
|
-
tableName: "r2_manifest";
|
|
120
|
-
dataType: "number int53";
|
|
121
|
-
data: number;
|
|
122
|
-
driverParam: number;
|
|
123
|
-
notNull: true;
|
|
124
|
-
hasDefault: true;
|
|
125
|
-
isPrimaryKey: false;
|
|
126
|
-
isAutoincrement: false;
|
|
127
|
-
hasRuntimeDefault: false;
|
|
128
|
-
enumValues: undefined;
|
|
129
|
-
baseColumn: never;
|
|
130
|
-
identity: undefined;
|
|
131
|
-
generated: undefined;
|
|
132
|
-
}, {}>;
|
|
133
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
134
|
-
name: string;
|
|
135
|
-
tableName: "r2_manifest";
|
|
136
|
-
dataType: "number int53";
|
|
137
|
-
data: number;
|
|
138
|
-
driverParam: number;
|
|
139
|
-
notNull: true;
|
|
140
|
-
hasDefault: false;
|
|
141
|
-
isPrimaryKey: false;
|
|
142
|
-
isAutoincrement: false;
|
|
143
|
-
hasRuntimeDefault: false;
|
|
144
|
-
enumValues: undefined;
|
|
145
|
-
baseColumn: never;
|
|
146
|
-
identity: undefined;
|
|
147
|
-
generated: undefined;
|
|
148
|
-
}, {}>;
|
|
149
|
-
retiredAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
150
|
-
name: string;
|
|
151
|
-
tableName: "r2_manifest";
|
|
152
|
-
dataType: "number int53";
|
|
153
|
-
data: number;
|
|
154
|
-
driverParam: number;
|
|
155
|
-
notNull: false;
|
|
156
|
-
hasDefault: false;
|
|
157
|
-
isPrimaryKey: false;
|
|
158
|
-
isAutoincrement: false;
|
|
159
|
-
hasRuntimeDefault: false;
|
|
160
|
-
enumValues: undefined;
|
|
161
|
-
baseColumn: never;
|
|
162
|
-
identity: undefined;
|
|
163
|
-
generated: undefined;
|
|
164
|
-
}, {}>;
|
|
165
|
-
tier: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
166
|
-
name: string;
|
|
167
|
-
tableName: "r2_manifest";
|
|
168
|
-
dataType: "string";
|
|
169
|
-
data: string;
|
|
170
|
-
driverParam: string;
|
|
171
|
-
notNull: false;
|
|
172
|
-
hasDefault: false;
|
|
173
|
-
isPrimaryKey: false;
|
|
174
|
-
isAutoincrement: false;
|
|
175
|
-
hasRuntimeDefault: false;
|
|
176
|
-
enumValues: [string, ...string[]];
|
|
177
|
-
baseColumn: never;
|
|
178
|
-
identity: undefined;
|
|
179
|
-
generated: undefined;
|
|
180
|
-
}, {}>;
|
|
181
|
-
searchType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
182
|
-
name: string;
|
|
183
|
-
tableName: "r2_manifest";
|
|
184
|
-
dataType: "string";
|
|
185
|
-
data: string;
|
|
186
|
-
driverParam: string;
|
|
187
|
-
notNull: false;
|
|
188
|
-
hasDefault: false;
|
|
189
|
-
isPrimaryKey: false;
|
|
190
|
-
isAutoincrement: false;
|
|
191
|
-
hasRuntimeDefault: false;
|
|
192
|
-
enumValues: [string, ...string[]];
|
|
193
|
-
baseColumn: never;
|
|
194
|
-
identity: undefined;
|
|
195
|
-
generated: undefined;
|
|
196
|
-
}, {}>;
|
|
197
|
-
schemaVersion: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
198
|
-
name: string;
|
|
199
|
-
tableName: "r2_manifest";
|
|
200
|
-
dataType: "number int53";
|
|
201
|
-
data: number;
|
|
202
|
-
driverParam: number;
|
|
203
|
-
notNull: false;
|
|
204
|
-
hasDefault: false;
|
|
205
|
-
isPrimaryKey: false;
|
|
206
|
-
isAutoincrement: false;
|
|
207
|
-
hasRuntimeDefault: false;
|
|
208
|
-
enumValues: undefined;
|
|
209
|
-
baseColumn: never;
|
|
210
|
-
identity: undefined;
|
|
211
|
-
generated: undefined;
|
|
212
|
-
}, {}>;
|
|
213
|
-
};
|
|
214
|
-
dialect: "sqlite";
|
|
215
|
-
}>;
|
|
216
|
-
type R2ManifestInsert = typeof r2Manifest.$inferInsert;
|
|
217
|
-
type R2ManifestSelect = typeof r2Manifest.$inferSelect;
|
|
218
|
-
declare const r2WriteErrors: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
219
|
-
name: "r2_write_errors";
|
|
220
|
-
schema: undefined;
|
|
221
|
-
columns: {
|
|
222
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
223
|
-
name: string;
|
|
224
|
-
tableName: "r2_write_errors";
|
|
225
|
-
dataType: "string";
|
|
226
|
-
data: string;
|
|
227
|
-
driverParam: string;
|
|
228
|
-
notNull: true;
|
|
229
|
-
hasDefault: false;
|
|
230
|
-
isPrimaryKey: true;
|
|
231
|
-
isAutoincrement: false;
|
|
232
|
-
hasRuntimeDefault: false;
|
|
233
|
-
enumValues: [string, ...string[]];
|
|
234
|
-
baseColumn: never;
|
|
235
|
-
identity: undefined;
|
|
236
|
-
generated: undefined;
|
|
237
|
-
}, {}>;
|
|
238
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
239
|
-
name: string;
|
|
240
|
-
tableName: "r2_write_errors";
|
|
241
|
-
dataType: "number int53";
|
|
242
|
-
data: number;
|
|
243
|
-
driverParam: number;
|
|
244
|
-
notNull: true;
|
|
245
|
-
hasDefault: false;
|
|
246
|
-
isPrimaryKey: false;
|
|
247
|
-
isAutoincrement: false;
|
|
248
|
-
hasRuntimeDefault: false;
|
|
249
|
-
enumValues: undefined;
|
|
250
|
-
baseColumn: never;
|
|
251
|
-
identity: undefined;
|
|
252
|
-
generated: undefined;
|
|
253
|
-
}, {}>;
|
|
254
|
-
siteId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
255
|
-
name: string;
|
|
256
|
-
tableName: "r2_write_errors";
|
|
257
|
-
dataType: "string";
|
|
258
|
-
data: string;
|
|
259
|
-
driverParam: string;
|
|
260
|
-
notNull: false;
|
|
261
|
-
hasDefault: false;
|
|
262
|
-
isPrimaryKey: false;
|
|
263
|
-
isAutoincrement: false;
|
|
264
|
-
hasRuntimeDefault: false;
|
|
265
|
-
enumValues: [string, ...string[]];
|
|
266
|
-
baseColumn: never;
|
|
267
|
-
identity: undefined;
|
|
268
|
-
generated: undefined;
|
|
269
|
-
}, {}>;
|
|
270
|
-
table: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
271
|
-
name: string;
|
|
272
|
-
tableName: "r2_write_errors";
|
|
273
|
-
dataType: "string";
|
|
274
|
-
data: string;
|
|
275
|
-
driverParam: string;
|
|
276
|
-
notNull: false;
|
|
277
|
-
hasDefault: false;
|
|
278
|
-
isPrimaryKey: false;
|
|
279
|
-
isAutoincrement: false;
|
|
280
|
-
hasRuntimeDefault: false;
|
|
281
|
-
enumValues: [string, ...string[]];
|
|
282
|
-
baseColumn: never;
|
|
283
|
-
identity: undefined;
|
|
284
|
-
generated: undefined;
|
|
285
|
-
}, {}>;
|
|
286
|
-
date: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
287
|
-
name: string;
|
|
288
|
-
tableName: "r2_write_errors";
|
|
289
|
-
dataType: "string";
|
|
290
|
-
data: string;
|
|
291
|
-
driverParam: string;
|
|
292
|
-
notNull: false;
|
|
293
|
-
hasDefault: false;
|
|
294
|
-
isPrimaryKey: false;
|
|
295
|
-
isAutoincrement: false;
|
|
296
|
-
hasRuntimeDefault: false;
|
|
297
|
-
enumValues: [string, ...string[]];
|
|
298
|
-
baseColumn: never;
|
|
299
|
-
identity: undefined;
|
|
300
|
-
generated: undefined;
|
|
301
|
-
}, {}>;
|
|
302
|
-
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
303
|
-
name: string;
|
|
304
|
-
tableName: "r2_write_errors";
|
|
305
|
-
dataType: "string";
|
|
306
|
-
data: string;
|
|
307
|
-
driverParam: string;
|
|
308
|
-
notNull: true;
|
|
309
|
-
hasDefault: false;
|
|
310
|
-
isPrimaryKey: false;
|
|
311
|
-
isAutoincrement: false;
|
|
312
|
-
hasRuntimeDefault: false;
|
|
313
|
-
enumValues: [string, ...string[]];
|
|
314
|
-
baseColumn: never;
|
|
315
|
-
identity: undefined;
|
|
316
|
-
generated: undefined;
|
|
317
|
-
}, {}>;
|
|
318
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
319
|
-
name: string;
|
|
320
|
-
tableName: "r2_write_errors";
|
|
321
|
-
dataType: "number int53";
|
|
322
|
-
data: number;
|
|
323
|
-
driverParam: number;
|
|
324
|
-
notNull: true;
|
|
325
|
-
hasDefault: true;
|
|
326
|
-
isPrimaryKey: false;
|
|
327
|
-
isAutoincrement: false;
|
|
328
|
-
hasRuntimeDefault: false;
|
|
329
|
-
enumValues: undefined;
|
|
330
|
-
baseColumn: never;
|
|
331
|
-
identity: undefined;
|
|
332
|
-
generated: undefined;
|
|
333
|
-
}, {}>;
|
|
334
|
-
};
|
|
335
|
-
dialect: "sqlite";
|
|
336
|
-
}>;
|
|
337
|
-
type R2WriteErrorInsert = typeof r2WriteErrors.$inferInsert;
|
|
338
|
-
type R2WriteErrorSelect = typeof r2WriteErrors.$inferSelect;
|
|
339
|
-
declare const r2ShadowDiffs: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
340
|
-
name: "r2_shadow_diffs";
|
|
341
|
-
schema: undefined;
|
|
342
|
-
columns: {
|
|
343
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
344
|
-
name: string;
|
|
345
|
-
tableName: "r2_shadow_diffs";
|
|
346
|
-
dataType: "string";
|
|
347
|
-
data: string;
|
|
348
|
-
driverParam: string;
|
|
349
|
-
notNull: true;
|
|
350
|
-
hasDefault: false;
|
|
351
|
-
isPrimaryKey: true;
|
|
352
|
-
isAutoincrement: false;
|
|
353
|
-
hasRuntimeDefault: false;
|
|
354
|
-
enumValues: [string, ...string[]];
|
|
355
|
-
baseColumn: never;
|
|
356
|
-
identity: undefined;
|
|
357
|
-
generated: undefined;
|
|
358
|
-
}, {}>;
|
|
359
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
360
|
-
name: string;
|
|
361
|
-
tableName: "r2_shadow_diffs";
|
|
362
|
-
dataType: "number int53";
|
|
363
|
-
data: number;
|
|
364
|
-
driverParam: number;
|
|
365
|
-
notNull: true;
|
|
366
|
-
hasDefault: false;
|
|
367
|
-
isPrimaryKey: false;
|
|
368
|
-
isAutoincrement: false;
|
|
369
|
-
hasRuntimeDefault: false;
|
|
370
|
-
enumValues: undefined;
|
|
371
|
-
baseColumn: never;
|
|
372
|
-
identity: undefined;
|
|
373
|
-
generated: undefined;
|
|
374
|
-
}, {}>;
|
|
375
|
-
siteId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
376
|
-
name: string;
|
|
377
|
-
tableName: "r2_shadow_diffs";
|
|
378
|
-
dataType: "string";
|
|
379
|
-
data: string;
|
|
380
|
-
driverParam: string;
|
|
381
|
-
notNull: false;
|
|
382
|
-
hasDefault: false;
|
|
383
|
-
isPrimaryKey: false;
|
|
384
|
-
isAutoincrement: false;
|
|
385
|
-
hasRuntimeDefault: false;
|
|
386
|
-
enumValues: [string, ...string[]];
|
|
387
|
-
baseColumn: never;
|
|
388
|
-
identity: undefined;
|
|
389
|
-
generated: undefined;
|
|
390
|
-
}, {}>;
|
|
391
|
-
endpoint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
392
|
-
name: string;
|
|
393
|
-
tableName: "r2_shadow_diffs";
|
|
394
|
-
dataType: "string";
|
|
395
|
-
data: string;
|
|
396
|
-
driverParam: string;
|
|
397
|
-
notNull: true;
|
|
398
|
-
hasDefault: false;
|
|
399
|
-
isPrimaryKey: false;
|
|
400
|
-
isAutoincrement: false;
|
|
401
|
-
hasRuntimeDefault: false;
|
|
402
|
-
enumValues: [string, ...string[]];
|
|
403
|
-
baseColumn: never;
|
|
404
|
-
identity: undefined;
|
|
405
|
-
generated: undefined;
|
|
406
|
-
}, {}>;
|
|
407
|
-
diff: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
408
|
-
name: string;
|
|
409
|
-
tableName: "r2_shadow_diffs";
|
|
410
|
-
dataType: "string";
|
|
411
|
-
data: string;
|
|
412
|
-
driverParam: string;
|
|
413
|
-
notNull: true;
|
|
414
|
-
hasDefault: false;
|
|
415
|
-
isPrimaryKey: false;
|
|
416
|
-
isAutoincrement: false;
|
|
417
|
-
hasRuntimeDefault: false;
|
|
418
|
-
enumValues: [string, ...string[]];
|
|
419
|
-
baseColumn: never;
|
|
420
|
-
identity: undefined;
|
|
421
|
-
generated: undefined;
|
|
422
|
-
}, {}>;
|
|
423
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
424
|
-
name: string;
|
|
425
|
-
tableName: "r2_shadow_diffs";
|
|
426
|
-
dataType: "number int53";
|
|
427
|
-
data: number;
|
|
428
|
-
driverParam: number;
|
|
429
|
-
notNull: true;
|
|
430
|
-
hasDefault: true;
|
|
431
|
-
isPrimaryKey: false;
|
|
432
|
-
isAutoincrement: false;
|
|
433
|
-
hasRuntimeDefault: false;
|
|
434
|
-
enumValues: undefined;
|
|
435
|
-
baseColumn: never;
|
|
436
|
-
identity: undefined;
|
|
437
|
-
generated: undefined;
|
|
438
|
-
}, {}>;
|
|
439
|
-
};
|
|
440
|
-
dialect: "sqlite";
|
|
441
|
-
}>;
|
|
442
|
-
type R2ShadowDiffInsert = typeof r2ShadowDiffs.$inferInsert;
|
|
443
|
-
type R2ShadowDiffSelect = typeof r2ShadowDiffs.$inferSelect;
|
|
444
|
-
declare const r2Locks: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
445
|
-
name: "r2_locks";
|
|
446
|
-
schema: undefined;
|
|
447
|
-
columns: {
|
|
448
|
-
scope: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
449
|
-
name: string;
|
|
450
|
-
tableName: "r2_locks";
|
|
451
|
-
dataType: "string";
|
|
452
|
-
data: string;
|
|
453
|
-
driverParam: string;
|
|
454
|
-
notNull: true;
|
|
455
|
-
hasDefault: false;
|
|
456
|
-
isPrimaryKey: true;
|
|
457
|
-
isAutoincrement: false;
|
|
458
|
-
hasRuntimeDefault: false;
|
|
459
|
-
enumValues: [string, ...string[]];
|
|
460
|
-
baseColumn: never;
|
|
461
|
-
identity: undefined;
|
|
462
|
-
generated: undefined;
|
|
463
|
-
}, {}>;
|
|
464
|
-
holderId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
465
|
-
name: string;
|
|
466
|
-
tableName: "r2_locks";
|
|
467
|
-
dataType: "string";
|
|
468
|
-
data: string;
|
|
469
|
-
driverParam: string;
|
|
470
|
-
notNull: true;
|
|
471
|
-
hasDefault: false;
|
|
472
|
-
isPrimaryKey: false;
|
|
473
|
-
isAutoincrement: false;
|
|
474
|
-
hasRuntimeDefault: false;
|
|
475
|
-
enumValues: [string, ...string[]];
|
|
476
|
-
baseColumn: never;
|
|
477
|
-
identity: undefined;
|
|
478
|
-
generated: undefined;
|
|
479
|
-
}, {}>;
|
|
480
|
-
acquiredAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
481
|
-
name: string;
|
|
482
|
-
tableName: "r2_locks";
|
|
483
|
-
dataType: "number int53";
|
|
484
|
-
data: number;
|
|
485
|
-
driverParam: number;
|
|
486
|
-
notNull: true;
|
|
487
|
-
hasDefault: false;
|
|
488
|
-
isPrimaryKey: false;
|
|
489
|
-
isAutoincrement: false;
|
|
490
|
-
hasRuntimeDefault: false;
|
|
491
|
-
enumValues: undefined;
|
|
492
|
-
baseColumn: never;
|
|
493
|
-
identity: undefined;
|
|
494
|
-
generated: undefined;
|
|
495
|
-
}, {}>;
|
|
496
|
-
expiresAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
497
|
-
name: string;
|
|
498
|
-
tableName: "r2_locks";
|
|
499
|
-
dataType: "number int53";
|
|
500
|
-
data: number;
|
|
501
|
-
driverParam: number;
|
|
502
|
-
notNull: true;
|
|
503
|
-
hasDefault: false;
|
|
504
|
-
isPrimaryKey: false;
|
|
505
|
-
isAutoincrement: false;
|
|
506
|
-
hasRuntimeDefault: false;
|
|
507
|
-
enumValues: undefined;
|
|
508
|
-
baseColumn: never;
|
|
509
|
-
identity: undefined;
|
|
510
|
-
generated: undefined;
|
|
511
|
-
}, {}>;
|
|
512
|
-
};
|
|
513
|
-
dialect: "sqlite";
|
|
514
|
-
}>;
|
|
515
|
-
type R2LockInsert = typeof r2Locks.$inferInsert;
|
|
516
|
-
type R2LockSelect = typeof r2Locks.$inferSelect;
|
|
517
|
-
declare const r2Watermarks: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
518
|
-
name: "r2_watermarks";
|
|
519
|
-
schema: undefined;
|
|
520
|
-
columns: {
|
|
521
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
522
|
-
name: string;
|
|
523
|
-
tableName: "r2_watermarks";
|
|
524
|
-
dataType: "number int53";
|
|
525
|
-
data: number;
|
|
526
|
-
driverParam: number;
|
|
527
|
-
notNull: true;
|
|
528
|
-
hasDefault: false;
|
|
529
|
-
isPrimaryKey: false;
|
|
530
|
-
isAutoincrement: false;
|
|
531
|
-
hasRuntimeDefault: false;
|
|
532
|
-
enumValues: undefined;
|
|
533
|
-
baseColumn: never;
|
|
534
|
-
identity: undefined;
|
|
535
|
-
generated: undefined;
|
|
536
|
-
}, {}>;
|
|
537
|
-
siteId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
538
|
-
name: string;
|
|
539
|
-
tableName: "r2_watermarks";
|
|
540
|
-
dataType: "string";
|
|
541
|
-
data: string;
|
|
542
|
-
driverParam: string;
|
|
543
|
-
notNull: true;
|
|
544
|
-
hasDefault: true;
|
|
545
|
-
isPrimaryKey: false;
|
|
546
|
-
isAutoincrement: false;
|
|
547
|
-
hasRuntimeDefault: false;
|
|
548
|
-
enumValues: [string, ...string[]];
|
|
549
|
-
baseColumn: never;
|
|
550
|
-
identity: undefined;
|
|
551
|
-
generated: undefined;
|
|
552
|
-
}, {}>;
|
|
553
|
-
table: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
554
|
-
name: string;
|
|
555
|
-
tableName: "r2_watermarks";
|
|
556
|
-
dataType: "string";
|
|
557
|
-
data: string;
|
|
558
|
-
driverParam: string;
|
|
559
|
-
notNull: true;
|
|
560
|
-
hasDefault: false;
|
|
561
|
-
isPrimaryKey: false;
|
|
562
|
-
isAutoincrement: false;
|
|
563
|
-
hasRuntimeDefault: false;
|
|
564
|
-
enumValues: [string, ...string[]];
|
|
565
|
-
baseColumn: never;
|
|
566
|
-
identity: undefined;
|
|
567
|
-
generated: undefined;
|
|
568
|
-
}, {}>;
|
|
569
|
-
newestDateSynced: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
570
|
-
name: string;
|
|
571
|
-
tableName: "r2_watermarks";
|
|
572
|
-
dataType: "string";
|
|
573
|
-
data: string;
|
|
574
|
-
driverParam: string;
|
|
575
|
-
notNull: true;
|
|
576
|
-
hasDefault: false;
|
|
577
|
-
isPrimaryKey: false;
|
|
578
|
-
isAutoincrement: false;
|
|
579
|
-
hasRuntimeDefault: false;
|
|
580
|
-
enumValues: [string, ...string[]];
|
|
581
|
-
baseColumn: never;
|
|
582
|
-
identity: undefined;
|
|
583
|
-
generated: undefined;
|
|
584
|
-
}, {}>;
|
|
585
|
-
oldestDateSynced: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
586
|
-
name: string;
|
|
587
|
-
tableName: "r2_watermarks";
|
|
588
|
-
dataType: "string";
|
|
589
|
-
data: string;
|
|
590
|
-
driverParam: string;
|
|
591
|
-
notNull: true;
|
|
592
|
-
hasDefault: false;
|
|
593
|
-
isPrimaryKey: false;
|
|
594
|
-
isAutoincrement: false;
|
|
595
|
-
hasRuntimeDefault: false;
|
|
596
|
-
enumValues: [string, ...string[]];
|
|
597
|
-
baseColumn: never;
|
|
598
|
-
identity: undefined;
|
|
599
|
-
generated: undefined;
|
|
600
|
-
}, {}>;
|
|
601
|
-
lastSyncAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
602
|
-
name: string;
|
|
603
|
-
tableName: "r2_watermarks";
|
|
604
|
-
dataType: "number int53";
|
|
605
|
-
data: number;
|
|
606
|
-
driverParam: number;
|
|
607
|
-
notNull: true;
|
|
608
|
-
hasDefault: false;
|
|
609
|
-
isPrimaryKey: false;
|
|
610
|
-
isAutoincrement: false;
|
|
611
|
-
hasRuntimeDefault: false;
|
|
612
|
-
enumValues: undefined;
|
|
613
|
-
baseColumn: never;
|
|
614
|
-
identity: undefined;
|
|
615
|
-
generated: undefined;
|
|
616
|
-
}, {}>;
|
|
617
|
-
};
|
|
618
|
-
dialect: "sqlite";
|
|
619
|
-
}>;
|
|
620
|
-
type R2WatermarkInsert = typeof r2Watermarks.$inferInsert;
|
|
621
|
-
type R2WatermarkSelect = typeof r2Watermarks.$inferSelect;
|
|
622
|
-
declare const r2SyncStates: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
623
|
-
name: "r2_sync_states";
|
|
624
|
-
schema: undefined;
|
|
625
|
-
columns: {
|
|
626
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
627
|
-
name: string;
|
|
628
|
-
tableName: "r2_sync_states";
|
|
629
|
-
dataType: "number int53";
|
|
630
|
-
data: number;
|
|
631
|
-
driverParam: number;
|
|
632
|
-
notNull: true;
|
|
633
|
-
hasDefault: false;
|
|
634
|
-
isPrimaryKey: false;
|
|
635
|
-
isAutoincrement: false;
|
|
636
|
-
hasRuntimeDefault: false;
|
|
637
|
-
enumValues: undefined;
|
|
638
|
-
baseColumn: never;
|
|
639
|
-
identity: undefined;
|
|
640
|
-
generated: undefined;
|
|
641
|
-
}, {}>;
|
|
642
|
-
siteId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
643
|
-
name: string;
|
|
644
|
-
tableName: "r2_sync_states";
|
|
645
|
-
dataType: "string";
|
|
646
|
-
data: string;
|
|
647
|
-
driverParam: string;
|
|
648
|
-
notNull: true;
|
|
649
|
-
hasDefault: true;
|
|
650
|
-
isPrimaryKey: false;
|
|
651
|
-
isAutoincrement: false;
|
|
652
|
-
hasRuntimeDefault: false;
|
|
653
|
-
enumValues: [string, ...string[]];
|
|
654
|
-
baseColumn: never;
|
|
655
|
-
identity: undefined;
|
|
656
|
-
generated: undefined;
|
|
657
|
-
}, {}>;
|
|
658
|
-
table: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
659
|
-
name: string;
|
|
660
|
-
tableName: "r2_sync_states";
|
|
661
|
-
dataType: "string";
|
|
662
|
-
data: string;
|
|
663
|
-
driverParam: string;
|
|
664
|
-
notNull: true;
|
|
665
|
-
hasDefault: false;
|
|
666
|
-
isPrimaryKey: false;
|
|
667
|
-
isAutoincrement: false;
|
|
668
|
-
hasRuntimeDefault: false;
|
|
669
|
-
enumValues: [string, ...string[]];
|
|
670
|
-
baseColumn: never;
|
|
671
|
-
identity: undefined;
|
|
672
|
-
generated: undefined;
|
|
673
|
-
}, {}>;
|
|
674
|
-
date: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
675
|
-
name: string;
|
|
676
|
-
tableName: "r2_sync_states";
|
|
677
|
-
dataType: "string";
|
|
678
|
-
data: string;
|
|
679
|
-
driverParam: string;
|
|
680
|
-
notNull: true;
|
|
681
|
-
hasDefault: false;
|
|
682
|
-
isPrimaryKey: false;
|
|
683
|
-
isAutoincrement: false;
|
|
684
|
-
hasRuntimeDefault: false;
|
|
685
|
-
enumValues: [string, ...string[]];
|
|
686
|
-
baseColumn: never;
|
|
687
|
-
identity: undefined;
|
|
688
|
-
generated: undefined;
|
|
689
|
-
}, {}>;
|
|
690
|
-
searchType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
691
|
-
name: string;
|
|
692
|
-
tableName: "r2_sync_states";
|
|
693
|
-
dataType: "string";
|
|
694
|
-
data: string;
|
|
695
|
-
driverParam: string;
|
|
696
|
-
notNull: true;
|
|
697
|
-
hasDefault: true;
|
|
698
|
-
isPrimaryKey: false;
|
|
699
|
-
isAutoincrement: false;
|
|
700
|
-
hasRuntimeDefault: false;
|
|
701
|
-
enumValues: [string, ...string[]];
|
|
702
|
-
baseColumn: never;
|
|
703
|
-
identity: undefined;
|
|
704
|
-
generated: undefined;
|
|
705
|
-
}, {}>;
|
|
706
|
-
state: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
707
|
-
name: string;
|
|
708
|
-
tableName: "r2_sync_states";
|
|
709
|
-
dataType: "string enum";
|
|
710
|
-
data: "pending" | "inflight" | "done" | "failed";
|
|
711
|
-
driverParam: string;
|
|
712
|
-
notNull: true;
|
|
713
|
-
hasDefault: false;
|
|
714
|
-
isPrimaryKey: false;
|
|
715
|
-
isAutoincrement: false;
|
|
716
|
-
hasRuntimeDefault: false;
|
|
717
|
-
enumValues: ["pending", "inflight", "done", "failed"];
|
|
718
|
-
baseColumn: never;
|
|
719
|
-
identity: undefined;
|
|
720
|
-
generated: undefined;
|
|
721
|
-
}, {}>;
|
|
722
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
723
|
-
name: string;
|
|
724
|
-
tableName: "r2_sync_states";
|
|
725
|
-
dataType: "number int53";
|
|
726
|
-
data: number;
|
|
727
|
-
driverParam: number;
|
|
728
|
-
notNull: true;
|
|
729
|
-
hasDefault: false;
|
|
730
|
-
isPrimaryKey: false;
|
|
731
|
-
isAutoincrement: false;
|
|
732
|
-
hasRuntimeDefault: false;
|
|
733
|
-
enumValues: undefined;
|
|
734
|
-
baseColumn: never;
|
|
735
|
-
identity: undefined;
|
|
736
|
-
generated: undefined;
|
|
737
|
-
}, {}>;
|
|
738
|
-
attempts: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
739
|
-
name: string;
|
|
740
|
-
tableName: "r2_sync_states";
|
|
741
|
-
dataType: "number int53";
|
|
742
|
-
data: number;
|
|
743
|
-
driverParam: number;
|
|
744
|
-
notNull: true;
|
|
745
|
-
hasDefault: true;
|
|
746
|
-
isPrimaryKey: false;
|
|
747
|
-
isAutoincrement: false;
|
|
748
|
-
hasRuntimeDefault: false;
|
|
749
|
-
enumValues: undefined;
|
|
750
|
-
baseColumn: never;
|
|
751
|
-
identity: undefined;
|
|
752
|
-
generated: undefined;
|
|
753
|
-
}, {}>;
|
|
754
|
-
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
755
|
-
name: string;
|
|
756
|
-
tableName: "r2_sync_states";
|
|
757
|
-
dataType: "string";
|
|
758
|
-
data: string;
|
|
759
|
-
driverParam: string;
|
|
760
|
-
notNull: false;
|
|
761
|
-
hasDefault: false;
|
|
762
|
-
isPrimaryKey: false;
|
|
763
|
-
isAutoincrement: false;
|
|
764
|
-
hasRuntimeDefault: false;
|
|
765
|
-
enumValues: [string, ...string[]];
|
|
766
|
-
baseColumn: never;
|
|
767
|
-
identity: undefined;
|
|
768
|
-
generated: undefined;
|
|
769
|
-
}, {}>;
|
|
770
|
-
};
|
|
771
|
-
dialect: "sqlite";
|
|
772
|
-
}>;
|
|
773
|
-
type R2SyncStateInsert = typeof r2SyncStates.$inferInsert;
|
|
774
|
-
type R2SyncStateSelect = typeof r2SyncStates.$inferSelect;
|
|
775
|
-
export { R2LockInsert, R2LockSelect, R2ManifestInsert, R2ManifestSelect, R2ShadowDiffInsert, R2ShadowDiffSelect, R2SyncStateInsert, R2SyncStateSelect, R2WatermarkInsert, R2WatermarkSelect, R2WriteErrorInsert, R2WriteErrorSelect, r2Locks, r2Manifest, r2ShadowDiffs, r2SyncStates, r2Watermarks, r2WriteErrors };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { sql } from "drizzle-orm";
|
|
2
|
-
import { index, integer, primaryKey, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
|
|
3
|
-
const r2Manifest = sqliteTable("r2_manifest", {
|
|
4
|
-
id: text("id").primaryKey(),
|
|
5
|
-
userId: integer("user_id").notNull(),
|
|
6
|
-
siteId: text("site_id"),
|
|
7
|
-
table: text("table").notNull(),
|
|
8
|
-
partition: text("partition").notNull(),
|
|
9
|
-
objectKey: text("object_key").notNull(),
|
|
10
|
-
rowCount: integer("row_count").notNull().default(0),
|
|
11
|
-
bytes: integer("bytes").notNull().default(0),
|
|
12
|
-
createdAt: integer("created_at").notNull(),
|
|
13
|
-
retiredAt: integer("retired_at"),
|
|
14
|
-
tier: text("tier"),
|
|
15
|
-
searchType: text("search_type"),
|
|
16
|
-
schemaVersion: integer("schema_version")
|
|
17
|
-
}, (t) => [
|
|
18
|
-
index("idx_r2_manifest_live").on(t.userId, t.siteId, t.table, t.partition, t.retiredAt),
|
|
19
|
-
index("idx_r2_manifest_lookup").on(t.userId, t.siteId, t.table, t.searchType, t.tier, t.partition, t.retiredAt),
|
|
20
|
-
index("idx_r2_manifest_retired").on(t.retiredAt),
|
|
21
|
-
index("idx_r2_manifest_tier").on(t.userId, t.siteId, t.table, t.tier, t.retiredAt),
|
|
22
|
-
unique("r2_manifest_object_key_unique").on(t.objectKey)
|
|
23
|
-
]);
|
|
24
|
-
const r2WriteErrors = sqliteTable("r2_write_errors", {
|
|
25
|
-
id: text("id").primaryKey(),
|
|
26
|
-
userId: integer("user_id").notNull(),
|
|
27
|
-
siteId: text("site_id"),
|
|
28
|
-
table: text("table"),
|
|
29
|
-
date: text("date"),
|
|
30
|
-
error: text("error").notNull(),
|
|
31
|
-
createdAt: integer("created_at").notNull().default(sql`(unixepoch())`)
|
|
32
|
-
}, (t) => [index("idx_r2_write_errors_user").on(t.userId, t.createdAt), index("idx_r2_write_errors_created").on(t.createdAt)]);
|
|
33
|
-
const r2ShadowDiffs = sqliteTable("r2_shadow_diffs", {
|
|
34
|
-
id: text("id").primaryKey(),
|
|
35
|
-
userId: integer("user_id").notNull(),
|
|
36
|
-
siteId: text("site_id"),
|
|
37
|
-
endpoint: text("endpoint").notNull(),
|
|
38
|
-
diff: text("diff").notNull(),
|
|
39
|
-
createdAt: integer("created_at").notNull().default(sql`(unixepoch())`)
|
|
40
|
-
}, (t) => [index("idx_r2_shadow_diffs_user").on(t.userId, t.createdAt), index("idx_r2_shadow_diffs_endpoint").on(t.endpoint, t.createdAt)]);
|
|
41
|
-
const r2Locks = sqliteTable("r2_locks", {
|
|
42
|
-
scope: text("scope").primaryKey(),
|
|
43
|
-
holderId: text("holder_id").notNull(),
|
|
44
|
-
acquiredAt: integer("acquired_at").notNull(),
|
|
45
|
-
expiresAt: integer("expires_at").notNull()
|
|
46
|
-
}, (t) => [index("idx_r2_locks_expires").on(t.expiresAt)]);
|
|
47
|
-
const r2Watermarks = sqliteTable("r2_watermarks", {
|
|
48
|
-
userId: integer("user_id").notNull(),
|
|
49
|
-
siteId: text("site_id").notNull().default(""),
|
|
50
|
-
table: text("table").notNull(),
|
|
51
|
-
newestDateSynced: text("newest_date_synced").notNull(),
|
|
52
|
-
oldestDateSynced: text("oldest_date_synced").notNull(),
|
|
53
|
-
lastSyncAt: integer("last_sync_at").notNull()
|
|
54
|
-
}, (t) => [primaryKey({ columns: [
|
|
55
|
-
t.userId,
|
|
56
|
-
t.siteId,
|
|
57
|
-
t.table
|
|
58
|
-
] })]);
|
|
59
|
-
const r2SyncStates = sqliteTable("r2_sync_states", {
|
|
60
|
-
userId: integer("user_id").notNull(),
|
|
61
|
-
siteId: text("site_id").notNull().default(""),
|
|
62
|
-
table: text("table").notNull(),
|
|
63
|
-
date: text("date").notNull(),
|
|
64
|
-
searchType: text("search_type").notNull().default(""),
|
|
65
|
-
state: text("state", { enum: [
|
|
66
|
-
"pending",
|
|
67
|
-
"inflight",
|
|
68
|
-
"done",
|
|
69
|
-
"failed"
|
|
70
|
-
] }).notNull(),
|
|
71
|
-
updatedAt: integer("updated_at").notNull(),
|
|
72
|
-
attempts: integer("attempts").notNull().default(0),
|
|
73
|
-
error: text("error")
|
|
74
|
-
}, (t) => [primaryKey({ columns: [
|
|
75
|
-
t.userId,
|
|
76
|
-
t.siteId,
|
|
77
|
-
t.table,
|
|
78
|
-
t.date,
|
|
79
|
-
t.searchType
|
|
80
|
-
] }), index("idx_r2_sync_states_state").on(t.state)]);
|
|
81
|
-
export { r2Locks, r2Manifest, r2ShadowDiffs, r2SyncStates, r2Watermarks, r2WriteErrors };
|