@storyshelf/db-sqlite 0.7.0 → 0.8.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/dist/better-sqlite3.d.mts +0 -2
- package/dist/better-sqlite3.mjs +2 -3
- package/dist/bun-sqlite.d.mts +0 -2
- package/dist/bun-sqlite.mjs +2 -3
- package/dist/d1.d.mts +0 -2
- package/dist/d1.mjs +2 -3
- package/dist/ddl.d.mts +1 -3
- package/dist/ddl.mjs +21 -2
- package/dist/ddl.mjs.map +1 -1
- package/dist/drizzle-factory.d.mts +0 -2
- package/dist/drizzle-factory.mjs +6 -3
- package/dist/drizzle-factory.mjs.map +1 -1
- package/dist/ensure-db-dir.mjs +2 -4
- package/dist/ensure-db-dir.mjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +3 -4
- package/dist/index.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +33 -16
- package/dist/schema/baseline.mjs +2 -2
- package/dist/schema/baseline.mjs.map +1 -1
- package/dist/schema/build-component.d.mts +9 -11
- package/dist/schema/build-component.mjs +1 -2
- package/dist/schema/build-review.d.mts +7 -9
- package/dist/schema/build-review.mjs +1 -2
- package/dist/schema/build.d.mts +43 -25
- package/dist/schema/build.mjs +2 -2
- package/dist/schema/build.mjs.map +1 -1
- package/dist/schema/capture-attempt.d.mts +25 -27
- package/dist/schema/capture-attempt.mjs +1 -2
- package/dist/schema/capture-job.d.mts +0 -2
- package/dist/schema/capture-job.mjs +1 -2
- package/dist/schema/capture-shard.d.mts +15 -17
- package/dist/schema/capture-shard.mjs +1 -2
- package/dist/schema/comment.d.mts +12 -14
- package/dist/schema/comment.mjs +1 -2
- package/dist/schema/connection.d.mts +10 -12
- package/dist/schema/connection.mjs +1 -2
- package/dist/schema/content-refs.d.mts +0 -2
- package/dist/schema/content-refs.mjs +1 -2
- package/dist/schema/design.d.mts +33 -35
- package/dist/schema/design.mjs +1 -2
- package/dist/schema/insight.d.mts +36 -38
- package/dist/schema/insight.mjs +1 -2
- package/dist/schema/label.d.mts +15 -17
- package/dist/schema/label.mjs +1 -2
- package/dist/schema/member.d.mts +7 -9
- package/dist/schema/member.mjs +1 -2
- package/dist/schema/notification.d.mts +20 -22
- package/dist/schema/notification.mjs +1 -2
- package/dist/schema/project-group-mapping.d.mts +6 -8
- package/dist/schema/project-group-mapping.mjs +1 -2
- package/dist/schema/project.d.mts +0 -2
- package/dist/schema/project.mjs +1 -2
- package/dist/schema/site-setting.d.mts +0 -2
- package/dist/schema/site-setting.mjs +1 -2
- package/dist/schema/snapshot.d.mts +91 -33
- package/dist/schema/snapshot.mjs +4 -2
- package/dist/schema/snapshot.mjs.map +1 -1
- package/dist/schema/token.d.mts +8 -10
- package/dist/schema/token.mjs +1 -2
- package/dist/schema/usage.d.mts +15 -17
- package/dist/schema/usage.mjs +1 -2
- package/dist/schema/user-invite.d.mts +7 -9
- package/dist/schema/user-invite.mjs +1 -2
- package/dist/schema/user.d.mts +0 -2
- package/dist/schema/user.mjs +1 -2
- package/dist/schema/webhook.d.mts +8 -10
- package/dist/schema/webhook.mjs +1 -2
- package/dist/schema.d.mts +0 -2
- package/dist/schema.mjs +1 -2
- package/dist/turso.d.mts +0 -2
- package/dist/turso.mjs +2 -3
- package/package.json +4 -4
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { DatabaseAdapter } from \"@storyshelf/core/adapter/database\";\nimport { drizzle, type AsyncRemoteCallback } from \"drizzle-orm/sqlite-proxy\";\nimport { DatabaseSync, type SQLInputValue } from \"node:sqlite\";\nimport { DDL, IDENTITY_STATEMENTS, tableColumns } from \"./ddl.ts\";\nimport { createDrizzleAdapter } from \"./drizzle-factory.ts\";\nimport { ensureDbDir } from \"./ensure-db-dir.ts\";\nimport { schema } from \"./schema/index.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Create a SQLite-backed DatabaseAdapter using node:sqlite and Drizzle ORM.\n *\n * @param path - Filesystem path to the SQLite database file.\n * @returns A DatabaseAdapter backed by the given SQLite file (WAL mode).\n */\nexport function createSqliteDatabase(path: string): DatabaseAdapter {\n ensureDbDir(path);\n const sqlite = new DatabaseSync(path, { returnArrays: true });\n sqlite.exec(\"PRAGMA journal_mode = WAL\");\n sqlite.exec(\"PRAGMA busy_timeout = 5000\");\n const callback = createCallback(sqlite);\n const db = drizzle(callback, { schema });\n\n return createDrizzleAdapter(db, {\n metadata: {\n name: \"SQLite\",\n version: typeof __PKG_VERSION__ === \"string\" ? __PKG_VERSION__ : \"0.0.0\",\n description: \"SQLite database adapter (node:sqlite + Drizzle)\",\n kind: \"sqlite\",\n category: \"database\",\n },\n tables: schema,\n migrate: () => {\n runMigrations(sqlite);\n },\n close: () => {\n sqlite.close();\n },\n ping: () => {\n sqlite.prepare(\"SELECT 1\").get();\n },\n });\n}\n\nconst WEBHOOK_SECRET_DROP = \"ALTER TABLE webhooks DROP COLUMN secret\";\n\n/**\n * Re-runs share `(project_id, git_sha)` by design (ULID build ids), so the\n * lookup index must not be unique. Existing databases created it UNIQUE —\n * drop and recreate it plain.\n */\nconst BUILDS_GITSHA_DEDUP = \"DROP INDEX IF EXISTS builds_project_gitsha_idx\";\nconst BUILDS_GITSHA_INDEX =\n \"CREATE INDEX IF NOT EXISTS builds_project_gitsha_idx ON builds (project_id, git_sha)\";\n\ntype ProxyMethod = \"run\" | \"all\" | \"values\" | \"get\";\n\n/**\n * Execute one Drizzle statement against DatabaseSync, returning proxy-shaped rows.\n * Drizzle builds the SQL and params; only the transport is hand-written.\n * `values` shares the `all` shape (array rows); the factory never emits it.\n * Note: for `get`, the proxy passes `result.rows` straight to the row mapper,\n * so `rows` is the single row (or undefined on a miss) — not a one-row array.\n */\nfunction executeStatement(\n sqlite: DatabaseSync,\n sql: string,\n params: unknown[],\n method: ProxyMethod,\n): { rows: unknown } {\n const stmt = sqlite.prepare(sql);\n // Single contained cast: Drizzle's params are SQLite scalars by construction.\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- tsc requires the narrowing; the rule misfires on the variadic overloads\n const args = params as SQLInputValue[];\n if (method === \"run\") {\n stmt.run(...args);\n return { rows: [] };\n }\n if (method === \"get\") {\n return { rows: stmt.get(...args) };\n }\n return { rows: stmt.all(...args) };\n}\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { DatabaseAdapter } from \"@storyshelf/core/adapter/database\";\nimport { drizzle, type AsyncRemoteCallback } from \"drizzle-orm/sqlite-proxy\";\nimport { DatabaseSync, type SQLInputValue } from \"node:sqlite\";\nimport { DDL, IDENTITY_STATEMENTS, tableColumns } from \"./ddl.ts\";\nimport { createDrizzleAdapter } from \"./drizzle-factory.ts\";\nimport { ensureDbDir } from \"./ensure-db-dir.ts\";\nimport { schema } from \"./schema/index.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Create a SQLite-backed DatabaseAdapter using node:sqlite and Drizzle ORM.\n *\n * @param path - Filesystem path to the SQLite database file.\n * @returns A DatabaseAdapter backed by the given SQLite file (WAL mode).\n */\nexport function createSqliteDatabase(path: string): DatabaseAdapter {\n ensureDbDir(path);\n const sqlite = new DatabaseSync(path, { returnArrays: true });\n sqlite.exec(\"PRAGMA journal_mode = WAL\");\n sqlite.exec(\"PRAGMA busy_timeout = 5000\");\n const callback = createCallback(sqlite);\n const db = drizzle(callback, { schema });\n\n return createDrizzleAdapter(db, {\n metadata: {\n name: \"SQLite\",\n version: typeof __PKG_VERSION__ === \"string\" ? __PKG_VERSION__ : \"0.0.0\",\n description: \"SQLite database adapter (node:sqlite + Drizzle)\",\n kind: \"sqlite\",\n category: \"database\",\n },\n tables: schema,\n migrate: () => {\n runMigrations(sqlite);\n },\n close: () => {\n sqlite.close();\n },\n ping: () => {\n sqlite.prepare(\"SELECT 1\").get();\n },\n });\n}\n\nconst WEBHOOK_SECRET_DROP = \"ALTER TABLE webhooks DROP COLUMN secret\";\n\n/**\n * Re-runs share `(project_id, git_sha)` by design (ULID build ids), so the\n * lookup index must not be unique. Existing databases created it UNIQUE —\n * drop and recreate it plain.\n */\nconst BUILDS_GITSHA_DEDUP = \"DROP INDEX IF EXISTS builds_project_gitsha_idx\";\nconst BUILDS_GITSHA_INDEX =\n \"CREATE INDEX IF NOT EXISTS builds_project_gitsha_idx ON builds (project_id, git_sha)\";\n\ntype ProxyMethod = \"run\" | \"all\" | \"values\" | \"get\";\n\n/**\n * Execute one Drizzle statement against DatabaseSync, returning proxy-shaped rows.\n * Drizzle builds the SQL and params; only the transport is hand-written.\n * `values` shares the `all` shape (array rows); the factory never emits it.\n * Note: for `get`, the proxy passes `result.rows` straight to the row mapper,\n * so `rows` is the single row (or undefined on a miss) — not a one-row array.\n */\nfunction executeStatement(\n sqlite: DatabaseSync,\n sql: string,\n params: unknown[],\n method: ProxyMethod,\n): { rows: unknown } {\n const stmt = sqlite.prepare(sql);\n // Single contained cast: Drizzle's params are SQLite scalars by construction.\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- tsc requires the narrowing; the rule misfires on the variadic overloads\n const args = params as SQLInputValue[];\n if (method === \"run\") {\n stmt.run(...args);\n return { rows: [] };\n }\n if (method === \"get\") {\n return { rows: stmt.get(...args) };\n }\n return { rows: stmt.all(...args) };\n}\n\nexport function createCallback(sqlite: DatabaseSync): AsyncRemoteCallback {\n const callback = (async (sql: string, params: unknown[], method: ProxyMethod) => {\n await Promise.resolve();\n return executeStatement(sqlite, sql, params, method);\n }) as AsyncRemoteCallback;\n return callback;\n}\n\nfunction execIgnore(sqlite: DatabaseSync, sql: string): void {\n try {\n sqlite.exec(sql);\n } catch {\n // idempotent — column already exists or other no-op\n }\n}\n\nfunction migrateCommentsTable(sqlite: DatabaseSync): void {\n const row = sqlite\n .prepare(\"SELECT sql FROM sqlite_master WHERE type='table' AND name='comments'\")\n .get() as { sql: string } | undefined;\n if (!row?.sql.includes(\"user_id TEXT NOT NULL REFERENCES users\")) {\n return;\n }\n sqlite.exec(\"PRAGMA foreign_keys = OFF\");\n sqlite.exec(`\n CREATE TABLE comments_new (\n id TEXT PRIMARY KEY,\n project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,\n build_id TEXT NOT NULL REFERENCES builds(id) ON DELETE CASCADE,\n snapshot_id TEXT REFERENCES snapshots(id) ON DELETE CASCADE,\n user_id TEXT REFERENCES users(id) ON DELETE CASCADE,\n body TEXT NOT NULL,\n parent_id TEXT,\n resolved INTEGER NOT NULL DEFAULT 0,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n )\n `);\n sqlite.exec(\"INSERT INTO comments_new SELECT * FROM comments\");\n sqlite.exec(\"DROP TABLE comments\");\n sqlite.exec(\"ALTER TABLE comments_new RENAME TO comments\");\n sqlite.exec(\"CREATE INDEX IF NOT EXISTS comments_build_id_idx ON comments (build_id)\");\n sqlite.exec(\"PRAGMA foreign_keys = ON\");\n}\n\n/** Add any DDL column missing from a volume created before it shipped. */\nfunction ensureColumns(sqlite: DatabaseSync, ddl: string): void {\n for (const [table, columns] of tableColumns(ddl)) {\n const rows = sqlite.prepare(`PRAGMA table_info(${table})`).all() as unknown as unknown[][];\n const existing = new Set(rows.map((row) => String(row[1])));\n for (const column of columns) {\n const [name] = column.split(/\\s+/u);\n if (name && !existing.has(name)) {\n execIgnore(sqlite, `ALTER TABLE ${table} ADD COLUMN ${column}`);\n }\n }\n }\n}\n\n/** Swap in the browser-aware unique indexes (after `ensureColumns` added the column). */\nfunction applyIdentityStatements(sqlite: DatabaseSync): void {\n for (const statement of IDENTITY_STATEMENTS) {\n execIgnore(sqlite, statement);\n }\n}\n\nfunction runMigrations(sqlite: DatabaseSync): void {\n sqlite.exec(\"PRAGMA foreign_keys = ON\");\n sqlite.exec(DDL);\n ensureColumns(sqlite, DDL);\n applyIdentityStatements(sqlite);\n try {\n sqlite.exec(WEBHOOK_SECRET_DROP);\n } catch {\n // already migrated — ignore\n }\n migrateBuildsGitShaIndex(sqlite);\n try {\n migrateCommentsTable(sqlite);\n } catch {\n execIgnore(sqlite, \"PRAGMA foreign_keys = ON\");\n }\n}\n\n/** Downgrade a legacy UNIQUE project/sha index to a plain lookup index. */\nfunction migrateBuildsGitShaIndex(sqlite: DatabaseSync): void {\n try {\n sqlite.exec(BUILDS_GITSHA_DEDUP);\n sqlite.exec(BUILDS_GITSHA_INDEX);\n } catch {\n // already migrated — ignore\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/schema/baseline.d.ts
|
|
4
3
|
/** Narrow `baselines` table definition. */
|
|
5
|
-
declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4
|
+
declare const baselines: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
6
5
|
name: "baselines";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
8
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "baselines";
|
|
12
11
|
dataType: "string";
|
|
@@ -25,7 +24,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
25
24
|
}, {}, {
|
|
26
25
|
length: number | undefined;
|
|
27
26
|
}>;
|
|
28
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
27
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
29
28
|
name: "project_id";
|
|
30
29
|
tableName: "baselines";
|
|
31
30
|
dataType: "string";
|
|
@@ -44,7 +43,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
44
43
|
}, {}, {
|
|
45
44
|
length: number | undefined;
|
|
46
45
|
}>;
|
|
47
|
-
storyId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
storyId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
48
47
|
name: "story_id";
|
|
49
48
|
tableName: "baselines";
|
|
50
49
|
dataType: "string";
|
|
@@ -63,7 +62,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
63
62
|
}, {}, {
|
|
64
63
|
length: number | undefined;
|
|
65
64
|
}>;
|
|
66
|
-
viewportName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
viewportName: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
67
66
|
name: "viewport_name";
|
|
68
67
|
tableName: "baselines";
|
|
69
68
|
dataType: "string";
|
|
@@ -82,7 +81,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
82
81
|
}, {}, {
|
|
83
82
|
length: number | undefined;
|
|
84
83
|
}>;
|
|
85
|
-
branch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
84
|
+
branch: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
86
85
|
name: "branch";
|
|
87
86
|
tableName: "baselines";
|
|
88
87
|
dataType: "string";
|
|
@@ -101,7 +100,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
101
100
|
}, {}, {
|
|
102
101
|
length: number | undefined;
|
|
103
102
|
}>;
|
|
104
|
-
snapshotId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
103
|
+
snapshotId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
105
104
|
name: "snapshot_id";
|
|
106
105
|
tableName: "baselines";
|
|
107
106
|
dataType: "string";
|
|
@@ -120,7 +119,26 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
120
119
|
}, {}, {
|
|
121
120
|
length: number | undefined;
|
|
122
121
|
}>;
|
|
123
|
-
|
|
122
|
+
sourceBuildId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
123
|
+
name: "source_build_id";
|
|
124
|
+
tableName: "baselines";
|
|
125
|
+
dataType: "string";
|
|
126
|
+
columnType: "SQLiteText";
|
|
127
|
+
data: string;
|
|
128
|
+
driverParam: string;
|
|
129
|
+
notNull: false;
|
|
130
|
+
hasDefault: false;
|
|
131
|
+
isPrimaryKey: false;
|
|
132
|
+
isAutoincrement: false;
|
|
133
|
+
hasRuntimeDefault: false;
|
|
134
|
+
enumValues: [string, ...string[]];
|
|
135
|
+
baseColumn: never;
|
|
136
|
+
identity: undefined;
|
|
137
|
+
generated: undefined;
|
|
138
|
+
}, {}, {
|
|
139
|
+
length: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
screenshotPath: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
124
142
|
name: "screenshot_path";
|
|
125
143
|
tableName: "baselines";
|
|
126
144
|
dataType: "string";
|
|
@@ -139,7 +157,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
139
157
|
}, {}, {
|
|
140
158
|
length: number | undefined;
|
|
141
159
|
}>;
|
|
142
|
-
infraHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
160
|
+
infraHash: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
143
161
|
name: "infra_hash";
|
|
144
162
|
tableName: "baselines";
|
|
145
163
|
dataType: "string";
|
|
@@ -158,7 +176,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
158
176
|
}, {}, {
|
|
159
177
|
length: number | undefined;
|
|
160
178
|
}>;
|
|
161
|
-
fingerprint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
179
|
+
fingerprint: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
162
180
|
name: "fingerprint";
|
|
163
181
|
tableName: "baselines";
|
|
164
182
|
dataType: "string";
|
|
@@ -177,7 +195,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
177
195
|
}, {}, {
|
|
178
196
|
length: number | undefined;
|
|
179
197
|
}>;
|
|
180
|
-
mode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
198
|
+
mode: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
181
199
|
name: "mode";
|
|
182
200
|
tableName: "baselines";
|
|
183
201
|
dataType: "string";
|
|
@@ -196,7 +214,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
196
214
|
}, {}, {
|
|
197
215
|
length: number | undefined;
|
|
198
216
|
}>;
|
|
199
|
-
browser: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
217
|
+
browser: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
200
218
|
name: "browser";
|
|
201
219
|
tableName: "baselines";
|
|
202
220
|
dataType: "string";
|
|
@@ -215,7 +233,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
215
233
|
}, {}, {
|
|
216
234
|
length: number | undefined;
|
|
217
235
|
}>;
|
|
218
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
236
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
219
237
|
name: "created_at";
|
|
220
238
|
tableName: "baselines";
|
|
221
239
|
dataType: "string";
|
|
@@ -234,7 +252,7 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
234
252
|
}, {}, {
|
|
235
253
|
length: number | undefined;
|
|
236
254
|
}>;
|
|
237
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
255
|
+
updatedAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
238
256
|
name: "updated_at";
|
|
239
257
|
tableName: "baselines";
|
|
240
258
|
dataType: "string";
|
|
@@ -256,6 +274,5 @@ declare const baselines: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
256
274
|
};
|
|
257
275
|
dialect: 'sqlite';
|
|
258
276
|
}>;
|
|
259
|
-
//#endregion
|
|
260
277
|
export { baselines };
|
|
261
278
|
//# sourceMappingURL=baseline.d.mts.map
|
package/dist/schema/baseline.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import "node:url";
|
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { index, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
6
|
-
|
|
6
|
+
// src/schema/baseline.ts
|
|
7
7
|
/** Narrow `baselines` table definition. */
|
|
8
8
|
const baselines = sqliteTable("baselines", {
|
|
9
9
|
id: text("id").primaryKey(),
|
|
@@ -12,6 +12,7 @@ const baselines = sqliteTable("baselines", {
|
|
|
12
12
|
viewportName: text("viewport_name").notNull().default("desktop"),
|
|
13
13
|
branch: text("branch").notNull(),
|
|
14
14
|
snapshotId: text("snapshot_id"),
|
|
15
|
+
sourceBuildId: text("source_build_id"),
|
|
15
16
|
screenshotPath: text("screenshot_path").notNull(),
|
|
16
17
|
infraHash: text("infra_hash"),
|
|
17
18
|
fingerprint: text("fingerprint"),
|
|
@@ -20,7 +21,6 @@ const baselines = sqliteTable("baselines", {
|
|
|
20
21
|
createdAt: text("created_at").notNull(),
|
|
21
22
|
updatedAt: text("updated_at").notNull()
|
|
22
23
|
}, (t) => [uniqueIndex("baselines_project_story_mode_browser_branch_idx").on(t.projectId, t.storyId, t.viewportName, t.browser, t.branch), index("baselines_project_story_idx").on(t.projectId, t.storyId)]);
|
|
23
|
-
//#endregion
|
|
24
24
|
export { baselines };
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=baseline.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseline.mjs","names":[],"sources":["../../src/schema/baseline.ts"],"sourcesContent":["import { index, sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `baselines` table definition. */\nexport const baselines = sqliteTable(\n \"baselines\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n storyId: text(\"story_id\").notNull(),\n viewportName: text(\"viewport_name\").notNull().default(\"desktop\"),\n branch: text(\"branch\").notNull(),\n snapshotId: text(\"snapshot_id\"),\n screenshotPath: text(\"screenshot_path\").notNull(),\n infraHash: text(\"infra_hash\"),\n fingerprint: text(\"fingerprint\"),\n mode: text(\"mode\"),\n browser: text(\"browser\").notNull().default(\"chromium\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (t) => [\n uniqueIndex(\"baselines_project_story_mode_browser_branch_idx\").on(\n t.projectId,\n t.storyId,\n t.viewportName,\n t.browser,\n t.branch,\n ),\n index(\"baselines_project_story_idx\").on(t.projectId, t.storyId),\n ],\n);\n\n/** A baseline row. */\nexport interface Baseline {\n id: string;\n projectId: string;\n storyId: string;\n viewportName: string;\n branch: string;\n snapshotId: string | null;\n screenshotPath: string;\n infraHash: string | null;\n fingerprint: string | null;\n mode: string | null;\n browser: string;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,YAAY,YACvB,aACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,cAAc,KAAK,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC/D,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,YAAY,KAAK,aAAa;CAC9B,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,WAAW,KAAK,YAAY;CAC5B,aAAa,KAAK,aAAa;CAC/B,MAAM,KAAK,MAAM;CACjB,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,UAAU;CACrD,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CACL,YAAY,iDAAiD,CAAC,CAAC,GAC7D,EAAE,WACF,EAAE,SACF,EAAE,cACF,EAAE,SACF,EAAE,MACJ,GACA,MAAM,6BAA6B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAChE,CACF"}
|
|
1
|
+
{"version":3,"file":"baseline.mjs","names":[],"sources":["../../src/schema/baseline.ts"],"sourcesContent":["import { index, sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `baselines` table definition. */\nexport const baselines = sqliteTable(\n \"baselines\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n storyId: text(\"story_id\").notNull(),\n viewportName: text(\"viewport_name\").notNull().default(\"desktop\"),\n branch: text(\"branch\").notNull(),\n snapshotId: text(\"snapshot_id\"),\n sourceBuildId: text(\"source_build_id\"),\n screenshotPath: text(\"screenshot_path\").notNull(),\n infraHash: text(\"infra_hash\"),\n fingerprint: text(\"fingerprint\"),\n mode: text(\"mode\"),\n browser: text(\"browser\").notNull().default(\"chromium\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (t) => [\n uniqueIndex(\"baselines_project_story_mode_browser_branch_idx\").on(\n t.projectId,\n t.storyId,\n t.viewportName,\n t.browser,\n t.branch,\n ),\n index(\"baselines_project_story_idx\").on(t.projectId, t.storyId),\n ],\n);\n\n/** A baseline row. */\nexport interface Baseline {\n id: string;\n projectId: string;\n storyId: string;\n viewportName: string;\n branch: string;\n snapshotId: string | null;\n sourceBuildId: string | null;\n screenshotPath: string;\n infraHash: string | null;\n fingerprint: string | null;\n mode: string | null;\n browser: string;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,YAAY,YACvB,aACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,cAAc,KAAK,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC/D,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,YAAY,KAAK,aAAa;CAC9B,eAAe,KAAK,iBAAiB;CACrC,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,WAAW,KAAK,YAAY;CAC5B,aAAa,KAAK,aAAa;CAC/B,MAAM,KAAK,MAAM;CACjB,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,UAAU;CACrD,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CACL,YAAY,iDAAiD,CAAC,CAAC,GAC7D,EAAE,WACF,EAAE,SACF,EAAE,cACF,EAAE,SACF,EAAE,MACJ,GACA,MAAM,6BAA6B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAChE,CACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/schema/build-component.d.ts
|
|
4
3
|
/** Narrow `build_components` table definition: one row per component of a published build. */
|
|
5
|
-
declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4
|
+
declare const buildComponents: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
6
5
|
name: "build_components";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
8
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "build_components";
|
|
12
11
|
dataType: "string";
|
|
@@ -25,7 +24,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
25
24
|
}, {}, {
|
|
26
25
|
length: number | undefined;
|
|
27
26
|
}>;
|
|
28
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
27
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
29
28
|
name: "project_id";
|
|
30
29
|
tableName: "build_components";
|
|
31
30
|
dataType: "string";
|
|
@@ -44,7 +43,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
44
43
|
}, {}, {
|
|
45
44
|
length: number | undefined;
|
|
46
45
|
}>;
|
|
47
|
-
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
buildId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
48
47
|
name: "build_id";
|
|
49
48
|
tableName: "build_components";
|
|
50
49
|
dataType: "string";
|
|
@@ -63,7 +62,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
63
62
|
}, {}, {
|
|
64
63
|
length: number | undefined;
|
|
65
64
|
}>;
|
|
66
|
-
importPath: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
importPath: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
67
66
|
name: "import_path";
|
|
68
67
|
tableName: "build_components";
|
|
69
68
|
dataType: "string";
|
|
@@ -82,7 +81,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
82
81
|
}, {}, {
|
|
83
82
|
length: number | undefined;
|
|
84
83
|
}>;
|
|
85
|
-
title: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
84
|
+
title: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
86
85
|
name: "title";
|
|
87
86
|
tableName: "build_components";
|
|
88
87
|
dataType: "string";
|
|
@@ -101,7 +100,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
101
100
|
}, {}, {
|
|
102
101
|
length: number | undefined;
|
|
103
102
|
}>;
|
|
104
|
-
storyCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
103
|
+
storyCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
105
104
|
name: "story_count";
|
|
106
105
|
tableName: "build_components";
|
|
107
106
|
dataType: "number";
|
|
@@ -118,7 +117,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
118
117
|
identity: undefined;
|
|
119
118
|
generated: undefined;
|
|
120
119
|
}, {}, {}>;
|
|
121
|
-
hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
120
|
+
hash: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
122
121
|
name: "hash";
|
|
123
122
|
tableName: "build_components";
|
|
124
123
|
dataType: "string";
|
|
@@ -137,7 +136,7 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
137
136
|
}, {}, {
|
|
138
137
|
length: number | undefined;
|
|
139
138
|
}>;
|
|
140
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
139
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
141
140
|
name: "created_at";
|
|
142
141
|
tableName: "build_components";
|
|
143
142
|
dataType: "string";
|
|
@@ -159,6 +158,5 @@ declare const buildComponents: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
159
158
|
};
|
|
160
159
|
dialect: 'sqlite';
|
|
161
160
|
}>;
|
|
162
|
-
//#endregion
|
|
163
161
|
export { buildComponents };
|
|
164
162
|
//# sourceMappingURL=build-component.d.mts.map
|
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { builds } from "./build.mjs";
|
|
6
6
|
import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
7
|
-
|
|
7
|
+
// src/schema/build-component.ts
|
|
8
8
|
/** Narrow `build_components` table definition: one row per component of a published build. */
|
|
9
9
|
const buildComponents = sqliteTable("build_components", {
|
|
10
10
|
id: text("id").primaryKey(),
|
|
@@ -16,7 +16,6 @@ const buildComponents = sqliteTable("build_components", {
|
|
|
16
16
|
hash: text("hash").notNull(),
|
|
17
17
|
createdAt: text("created_at").notNull()
|
|
18
18
|
}, (table) => [index("build_components_build_id_idx").on(table.buildId), index("build_components_project_import_path_idx").on(table.projectId, table.importPath)]);
|
|
19
|
-
//#endregion
|
|
20
19
|
export { buildComponents };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=build-component.mjs.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/schema/build-review.d.ts
|
|
4
3
|
/** Narrow `build_reviews` table definition: one verdict of one reviewer on one build. */
|
|
5
|
-
declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4
|
+
declare const buildReviews: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
6
5
|
name: "build_reviews";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
8
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "build_reviews";
|
|
12
11
|
dataType: "string";
|
|
@@ -25,7 +24,7 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
25
24
|
}, {}, {
|
|
26
25
|
length: number | undefined;
|
|
27
26
|
}>;
|
|
28
|
-
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
27
|
+
buildId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
29
28
|
name: "build_id";
|
|
30
29
|
tableName: "build_reviews";
|
|
31
30
|
dataType: "string";
|
|
@@ -44,7 +43,7 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
44
43
|
}, {}, {
|
|
45
44
|
length: number | undefined;
|
|
46
45
|
}>;
|
|
47
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
userId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
48
47
|
name: "user_id";
|
|
49
48
|
tableName: "build_reviews";
|
|
50
49
|
dataType: "string";
|
|
@@ -63,7 +62,7 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
63
62
|
}, {}, {
|
|
64
63
|
length: number | undefined;
|
|
65
64
|
}>;
|
|
66
|
-
verdict: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
verdict: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
67
66
|
name: "verdict";
|
|
68
67
|
tableName: "build_reviews";
|
|
69
68
|
dataType: "string";
|
|
@@ -83,7 +82,7 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
83
82
|
length: number | undefined;
|
|
84
83
|
$type: "approved" | "rejected";
|
|
85
84
|
}>;
|
|
86
|
-
body: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
85
|
+
body: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
87
86
|
name: "body";
|
|
88
87
|
tableName: "build_reviews";
|
|
89
88
|
dataType: "string";
|
|
@@ -102,7 +101,7 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
102
101
|
}, {}, {
|
|
103
102
|
length: number | undefined;
|
|
104
103
|
}>;
|
|
105
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
104
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
106
105
|
name: "created_at";
|
|
107
106
|
tableName: "build_reviews";
|
|
108
107
|
dataType: "string";
|
|
@@ -124,6 +123,5 @@ declare const buildReviews: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
124
123
|
};
|
|
125
124
|
dialect: 'sqlite';
|
|
126
125
|
}>;
|
|
127
|
-
//#endregion
|
|
128
126
|
export { buildReviews };
|
|
129
127
|
//# sourceMappingURL=build-review.d.mts.map
|
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { builds } from "./build.mjs";
|
|
5
5
|
import { users } from "./user.mjs";
|
|
6
6
|
import { index, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
7
|
-
|
|
7
|
+
// src/schema/build-review.ts
|
|
8
8
|
/** Narrow `build_reviews` table definition: one verdict of one reviewer on one build. */
|
|
9
9
|
const buildReviews = sqliteTable("build_reviews", {
|
|
10
10
|
id: text("id").primaryKey(),
|
|
@@ -14,7 +14,6 @@ const buildReviews = sqliteTable("build_reviews", {
|
|
|
14
14
|
body: text("body"),
|
|
15
15
|
createdAt: text("created_at").notNull()
|
|
16
16
|
}, (table) => [index("build_reviews_build_id_idx").on(table.buildId)]);
|
|
17
|
-
//#endregion
|
|
18
17
|
export { buildReviews };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=build-review.mjs.map
|
package/dist/schema/build.d.mts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { BuildStatus } from "@storyshelf/core/types";
|
|
4
|
-
//#region src/schema/build.d.ts
|
|
5
4
|
/** Narrow `builds` table definition. */
|
|
6
|
-
declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
5
|
+
declare const builds: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
7
6
|
name: "builds";
|
|
8
7
|
schema: undefined;
|
|
9
8
|
columns: {
|
|
10
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
9
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
11
10
|
name: "id";
|
|
12
11
|
tableName: "builds";
|
|
13
12
|
dataType: "string";
|
|
@@ -26,7 +25,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
26
25
|
}, {}, {
|
|
27
26
|
length: number | undefined;
|
|
28
27
|
}>;
|
|
29
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
28
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
30
29
|
name: "project_id";
|
|
31
30
|
tableName: "builds";
|
|
32
31
|
dataType: "string";
|
|
@@ -45,7 +44,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
45
44
|
}, {}, {
|
|
46
45
|
length: number | undefined;
|
|
47
46
|
}>;
|
|
48
|
-
gitSha: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
47
|
+
gitSha: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
49
48
|
name: "git_sha";
|
|
50
49
|
tableName: "builds";
|
|
51
50
|
dataType: "string";
|
|
@@ -64,7 +63,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
64
63
|
}, {}, {
|
|
65
64
|
length: number | undefined;
|
|
66
65
|
}>;
|
|
67
|
-
gitBranch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
66
|
+
gitBranch: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
68
67
|
name: "git_branch";
|
|
69
68
|
tableName: "builds";
|
|
70
69
|
dataType: "string";
|
|
@@ -83,7 +82,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
83
82
|
}, {}, {
|
|
84
83
|
length: number | undefined;
|
|
85
84
|
}>;
|
|
86
|
-
isDefault: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
85
|
+
isDefault: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
87
86
|
name: "is_default";
|
|
88
87
|
tableName: "builds";
|
|
89
88
|
dataType: "boolean";
|
|
@@ -100,7 +99,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
100
99
|
identity: undefined;
|
|
101
100
|
generated: undefined;
|
|
102
101
|
}, {}, {}>;
|
|
103
|
-
authorEmail: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
102
|
+
authorEmail: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
104
103
|
name: "author_email";
|
|
105
104
|
tableName: "builds";
|
|
106
105
|
dataType: "string";
|
|
@@ -119,7 +118,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
119
118
|
}, {}, {
|
|
120
119
|
length: number | undefined;
|
|
121
120
|
}>;
|
|
122
|
-
authorName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
121
|
+
authorName: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
123
122
|
name: "author_name";
|
|
124
123
|
tableName: "builds";
|
|
125
124
|
dataType: "string";
|
|
@@ -138,7 +137,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
138
137
|
}, {}, {
|
|
139
138
|
length: number | undefined;
|
|
140
139
|
}>;
|
|
141
|
-
message: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
140
|
+
message: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
142
141
|
name: "message";
|
|
143
142
|
tableName: "builds";
|
|
144
143
|
dataType: "string";
|
|
@@ -157,7 +156,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
157
156
|
}, {}, {
|
|
158
157
|
length: number | undefined;
|
|
159
158
|
}>;
|
|
160
|
-
public: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
159
|
+
public: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
161
160
|
name: "public";
|
|
162
161
|
tableName: "builds";
|
|
163
162
|
dataType: "boolean";
|
|
@@ -174,7 +173,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
174
173
|
identity: undefined;
|
|
175
174
|
generated: undefined;
|
|
176
175
|
}, {}, {}>;
|
|
177
|
-
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
176
|
+
status: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
178
177
|
name: "status";
|
|
179
178
|
tableName: "builds";
|
|
180
179
|
dataType: "string";
|
|
@@ -194,7 +193,26 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
194
193
|
length: number | undefined;
|
|
195
194
|
$type: "approved" | "cancelled" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
196
195
|
}>;
|
|
197
|
-
|
|
196
|
+
retentionState: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
197
|
+
name: "retention_state";
|
|
198
|
+
tableName: "builds";
|
|
199
|
+
dataType: "string";
|
|
200
|
+
columnType: "SQLiteText";
|
|
201
|
+
data: string;
|
|
202
|
+
driverParam: string;
|
|
203
|
+
notNull: true;
|
|
204
|
+
hasDefault: true;
|
|
205
|
+
isPrimaryKey: false;
|
|
206
|
+
isAutoincrement: false;
|
|
207
|
+
hasRuntimeDefault: false;
|
|
208
|
+
enumValues: [string, ...string[]];
|
|
209
|
+
baseColumn: never;
|
|
210
|
+
identity: undefined;
|
|
211
|
+
generated: undefined;
|
|
212
|
+
}, {}, {
|
|
213
|
+
length: number | undefined;
|
|
214
|
+
}>;
|
|
215
|
+
snapshotCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
198
216
|
name: "snapshot_count";
|
|
199
217
|
tableName: "builds";
|
|
200
218
|
dataType: "number";
|
|
@@ -211,7 +229,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
211
229
|
identity: undefined;
|
|
212
230
|
generated: undefined;
|
|
213
231
|
}, {}, {}>;
|
|
214
|
-
changedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
232
|
+
changedCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
215
233
|
name: "changed_count";
|
|
216
234
|
tableName: "builds";
|
|
217
235
|
dataType: "number";
|
|
@@ -228,7 +246,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
228
246
|
identity: undefined;
|
|
229
247
|
generated: undefined;
|
|
230
248
|
}, {}, {}>;
|
|
231
|
-
approvedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
249
|
+
approvedCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
232
250
|
name: "approved_count";
|
|
233
251
|
tableName: "builds";
|
|
234
252
|
dataType: "number";
|
|
@@ -245,7 +263,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
245
263
|
identity: undefined;
|
|
246
264
|
generated: undefined;
|
|
247
265
|
}, {}, {}>;
|
|
248
|
-
rejectedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
266
|
+
rejectedCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
249
267
|
name: "rejected_count";
|
|
250
268
|
tableName: "builds";
|
|
251
269
|
dataType: "number";
|
|
@@ -262,7 +280,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
262
280
|
identity: undefined;
|
|
263
281
|
generated: undefined;
|
|
264
282
|
}, {}, {}>;
|
|
265
|
-
inheritedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
283
|
+
inheritedCount: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
266
284
|
name: "inherited_count";
|
|
267
285
|
tableName: "builds";
|
|
268
286
|
dataType: "number";
|
|
@@ -279,7 +297,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
279
297
|
identity: undefined;
|
|
280
298
|
generated: undefined;
|
|
281
299
|
}, {}, {}>;
|
|
282
|
-
affectedOnly: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
300
|
+
affectedOnly: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
283
301
|
name: "affected_only";
|
|
284
302
|
tableName: "builds";
|
|
285
303
|
dataType: "boolean";
|
|
@@ -296,7 +314,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
296
314
|
identity: undefined;
|
|
297
315
|
generated: undefined;
|
|
298
316
|
}, {}, {}>;
|
|
299
|
-
baselineSha: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
317
|
+
baselineSha: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
300
318
|
name: "baseline_sha";
|
|
301
319
|
tableName: "builds";
|
|
302
320
|
dataType: "string";
|
|
@@ -315,7 +333,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
315
333
|
}, {}, {
|
|
316
334
|
length: number | undefined;
|
|
317
335
|
}>;
|
|
318
|
-
changedFiles: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
336
|
+
changedFiles: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
319
337
|
name: "changed_files";
|
|
320
338
|
tableName: "builds";
|
|
321
339
|
dataType: "string";
|
|
@@ -334,7 +352,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
334
352
|
}, {}, {
|
|
335
353
|
length: number | undefined;
|
|
336
354
|
}>;
|
|
337
|
-
affectedImportPaths: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
355
|
+
affectedImportPaths: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
338
356
|
name: "affected_import_paths";
|
|
339
357
|
tableName: "builds";
|
|
340
358
|
dataType: "string";
|
|
@@ -353,7 +371,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
353
371
|
}, {}, {
|
|
354
372
|
length: number | undefined;
|
|
355
373
|
}>;
|
|
356
|
-
testResults: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
374
|
+
testResults: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
357
375
|
name: "test_results";
|
|
358
376
|
tableName: "builds";
|
|
359
377
|
dataType: "string";
|
|
@@ -372,7 +390,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
372
390
|
}, {}, {
|
|
373
391
|
length: number | undefined;
|
|
374
392
|
}>;
|
|
375
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
393
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
376
394
|
name: "created_at";
|
|
377
395
|
tableName: "builds";
|
|
378
396
|
dataType: "string";
|
|
@@ -391,7 +409,7 @@ declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
|
391
409
|
}, {}, {
|
|
392
410
|
length: number | undefined;
|
|
393
411
|
}>;
|
|
394
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
412
|
+
updatedAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
395
413
|
name: "updated_at";
|
|
396
414
|
tableName: "builds";
|
|
397
415
|
dataType: "string";
|
|
@@ -425,6 +443,7 @@ interface Build {
|
|
|
425
443
|
message: string | null;
|
|
426
444
|
public: boolean;
|
|
427
445
|
status: BuildStatus;
|
|
446
|
+
retentionState: string;
|
|
428
447
|
snapshotCount: number;
|
|
429
448
|
changedCount: number;
|
|
430
449
|
approvedCount: number;
|
|
@@ -438,6 +457,5 @@ interface Build {
|
|
|
438
457
|
createdAt: string;
|
|
439
458
|
updatedAt: string;
|
|
440
459
|
}
|
|
441
|
-
//#endregion
|
|
442
460
|
export { Build, builds };
|
|
443
461
|
//# sourceMappingURL=build.d.mts.map
|