jukebox-media-server 0.5.1 → 0.7.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.
Files changed (32) hide show
  1. package/README.md +18 -20
  2. package/dist/client/assets/{Watch-Ja4PAA8Y.js → Watch-BiR2iXrC.js} +33 -33
  3. package/dist/client/assets/index-CKZbQJYY.css +1 -0
  4. package/dist/client/assets/index-CoxOmmZz.js +87 -0
  5. package/dist/client/index.html +2 -2
  6. package/dist/client/sw.js +1 -1
  7. package/dist/server/HttpApiBuilder-DWwOvarr.js +42786 -0
  8. package/dist/server/better-sqlite3-CkwhTVXW.js +129 -0
  9. package/dist/server/bun-database-CqinoQgb.js +14 -0
  10. package/dist/server/bun-database-oVoIc-C8.js +15 -0
  11. package/dist/server/bun-sqlite-Bk_yjDLi.js +134 -0
  12. package/dist/server/chunk-CrysgU_F.js +36 -0
  13. package/dist/server/config-CCAveLuN.js +12 -0
  14. package/dist/server/esm-Dm4Gq4cv.js +40975 -0
  15. package/dist/server/index.js +3884 -5603
  16. package/dist/server/{indexes-VMR6QVVl.js → indexes-vPbUiKXP.js} +4 -100
  17. package/dist/server/{better-sqlite3-Dy_YhTFe.js → logger-ygdFSBOU.js} +243 -368
  18. package/dist/server/{migrator-CWPnMvx5.js → migrator-8uumkKvi.js} +1 -7
  19. package/dist/server/migrator-CpDrzLY4.js +8 -0
  20. package/dist/server/migrator-D9F-ETAB.js +8 -0
  21. package/dist/server/schema-1sWMC8cP.js +59 -0
  22. package/dist/server/schema-B7-kIAVY.js +145 -0
  23. package/dist/server/select-62doObBa.js +101 -0
  24. package/drizzle/0011_loose_eternity.sql +1 -0
  25. package/drizzle/meta/0011_snapshot.json +1066 -0
  26. package/drizzle/meta/_journal.json +8 -1
  27. package/drizzle-telemetry/0000_great_thor.sql +45 -0
  28. package/drizzle-telemetry/meta/0000_snapshot.json +320 -0
  29. package/drizzle-telemetry/meta/_journal.json +13 -0
  30. package/package.json +22 -8
  31. package/dist/client/assets/index-AENKhh_8.css +0 -1
  32. package/dist/client/assets/index-Cm9WIhoR.js +0 -58
@@ -1,5 +1,5 @@
1
- import { $ as is, A as or, B as SQL, C as ne, D as notIlike, E as notExists, F as isConfig, G as Table, H as fillPlaceholders, I as mapResultRow, J as ViewBaseConfig, K as getTableName, L as mapUpdateSet, M as getTableColumns, N as getTableLikeName, O as notInArray, P as haveSameKeys, Q as entityKind, R as orderSelectedFields, S as lte, T as notBetween, U as sql, V as View, W as Columns, X as WithSubquery, Y as Subquery, Z as Column, _ as inArray, b as like, c as asc, d as between, f as eq, g as ilike, h as gte, j as applyMixins, k as notLike, l as desc, m as gt, n as SQLiteTable, p as exists, q as getTableUniqueName, s as SQLiteColumn, u as and, v as isNotNull, w as not, x as lt, y as isNull, z as Param } from "./indexes-VMR6QVVl.js";
2
- import Client from "better-sqlite3";
1
+ import { A as ViewBaseConfig, D as Table, E as Columns, F as is, M as WithSubquery, N as Column, O as getTableName, P as entityKind, T as sql, _ as Param, c as SQLiteColumn, d as getTableLikeName, f as haveSameKeys, g as orderSelectedFields, h as mapUpdateSet, j as Subquery, k as getTableUniqueName, l as applyMixins, r as SQLiteTable, u as getTableColumns, x as View, y as SQL } from "./indexes-vPbUiKXP.js";
2
+ import { C as or, S as notLike, _ as not, a as eq, b as notIlike, c as gte, d as isNotNull, f as isNull, g as ne, h as lte, i as between, l as ilike, m as lt, n as desc, o as exists, p as like, r as and, s as gt, t as asc, u as inArray, v as notBetween, x as notInArray, y as notExists } from "./select-62doObBa.js";
3
3
  //#region node_modules/drizzle-orm/alias.js
4
4
  var ColumnAliasProxyHandler = class {
5
5
  constructor(table) {
@@ -58,6 +58,223 @@ function mapColumnsInSQLToAlias(query, alias) {
58
58
  }));
59
59
  }
60
60
  //#endregion
61
+ //#region node_modules/drizzle-orm/selection-proxy.js
62
+ var SelectionProxyHandler = class SelectionProxyHandler {
63
+ static [entityKind] = "SelectionProxyHandler";
64
+ config;
65
+ constructor(config) {
66
+ this.config = { ...config };
67
+ }
68
+ get(subquery, prop) {
69
+ if (prop === "_") return {
70
+ ...subquery["_"],
71
+ selectedFields: new Proxy(subquery._.selectedFields, this)
72
+ };
73
+ if (prop === ViewBaseConfig) return {
74
+ ...subquery[ViewBaseConfig],
75
+ selectedFields: new Proxy(subquery[ViewBaseConfig].selectedFields, this)
76
+ };
77
+ if (typeof prop === "symbol") return subquery[prop];
78
+ const value = (is(subquery, Subquery) ? subquery._.selectedFields : is(subquery, View) ? subquery[ViewBaseConfig].selectedFields : subquery)[prop];
79
+ if (is(value, SQL.Aliased)) {
80
+ if (this.config.sqlAliasedBehavior === "sql" && !value.isSelectionField) return value.sql;
81
+ const newValue = value.clone();
82
+ newValue.isSelectionField = true;
83
+ return newValue;
84
+ }
85
+ if (is(value, SQL)) {
86
+ if (this.config.sqlBehavior === "sql") return value;
87
+ throw new Error(`You tried to reference "${prop}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`);
88
+ }
89
+ if (is(value, Column)) {
90
+ if (this.config.alias) return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(value.table, new TableAliasProxyHandler(this.config.alias, this.config.replaceOriginalName ?? false))));
91
+ return value;
92
+ }
93
+ if (typeof value !== "object" || value === null) return value;
94
+ return new Proxy(value, new SelectionProxyHandler(this.config));
95
+ }
96
+ };
97
+ //#endregion
98
+ //#region node_modules/drizzle-orm/query-promise.js
99
+ var QueryPromise = class {
100
+ static [entityKind] = "QueryPromise";
101
+ [Symbol.toStringTag] = "QueryPromise";
102
+ catch(onRejected) {
103
+ return this.then(void 0, onRejected);
104
+ }
105
+ finally(onFinally) {
106
+ return this.then((value) => {
107
+ onFinally?.();
108
+ return value;
109
+ }, (reason) => {
110
+ onFinally?.();
111
+ throw reason;
112
+ });
113
+ }
114
+ then(onFulfilled, onRejected) {
115
+ return this.execute().then(onFulfilled, onRejected);
116
+ }
117
+ };
118
+ //#endregion
119
+ //#region node_modules/drizzle-orm/sqlite-core/utils.js
120
+ function extractUsedTable(table) {
121
+ if (is(table, SQLiteTable)) return [`${table[Table.Symbol.BaseName]}`];
122
+ if (is(table, Subquery)) return table._.usedTables ?? [];
123
+ if (is(table, SQL)) return table.usedTables ?? [];
124
+ return [];
125
+ }
126
+ //#endregion
127
+ //#region node_modules/drizzle-orm/sqlite-core/query-builders/delete.js
128
+ var SQLiteDeleteBase = class extends QueryPromise {
129
+ constructor(table, session, dialect, withList) {
130
+ super();
131
+ this.table = table;
132
+ this.session = session;
133
+ this.dialect = dialect;
134
+ this.config = {
135
+ table,
136
+ withList
137
+ };
138
+ }
139
+ static [entityKind] = "SQLiteDelete";
140
+ /** @internal */
141
+ config;
142
+ /**
143
+ * Adds a `where` clause to the query.
144
+ *
145
+ * Calling this method will delete only those rows that fulfill a specified condition.
146
+ *
147
+ * See docs: {@link https://orm.drizzle.team/docs/delete}
148
+ *
149
+ * @param where the `where` clause.
150
+ *
151
+ * @example
152
+ * You can use conditional operators and `sql function` to filter the rows to be deleted.
153
+ *
154
+ * ```ts
155
+ * // Delete all cars with green color
156
+ * db.delete(cars).where(eq(cars.color, 'green'));
157
+ * // or
158
+ * db.delete(cars).where(sql`${cars.color} = 'green'`)
159
+ * ```
160
+ *
161
+ * You can logically combine conditional operators with `and()` and `or()` operators:
162
+ *
163
+ * ```ts
164
+ * // Delete all BMW cars with a green color
165
+ * db.delete(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
166
+ *
167
+ * // Delete all cars with the green or blue color
168
+ * db.delete(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
169
+ * ```
170
+ */
171
+ where(where) {
172
+ this.config.where = where;
173
+ return this;
174
+ }
175
+ orderBy(...columns) {
176
+ if (typeof columns[0] === "function") {
177
+ const orderBy = columns[0](new Proxy(this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({
178
+ sqlAliasedBehavior: "alias",
179
+ sqlBehavior: "sql"
180
+ })));
181
+ const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];
182
+ this.config.orderBy = orderByArray;
183
+ } else {
184
+ const orderByArray = columns;
185
+ this.config.orderBy = orderByArray;
186
+ }
187
+ return this;
188
+ }
189
+ limit(limit) {
190
+ this.config.limit = limit;
191
+ return this;
192
+ }
193
+ returning(fields = this.table[SQLiteTable.Symbol.Columns]) {
194
+ this.config.returning = orderSelectedFields(fields);
195
+ return this;
196
+ }
197
+ /** @internal */
198
+ getSQL() {
199
+ return this.dialect.buildDeleteQuery(this.config);
200
+ }
201
+ toSQL() {
202
+ const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
203
+ return rest;
204
+ }
205
+ /** @internal */
206
+ _prepare(isOneTimeQuery = true) {
207
+ return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"](this.dialect.sqlToQuery(this.getSQL()), this.config.returning, this.config.returning ? "all" : "run", true, void 0, {
208
+ type: "delete",
209
+ tables: extractUsedTable(this.config.table)
210
+ });
211
+ }
212
+ prepare() {
213
+ return this._prepare(false);
214
+ }
215
+ run = (placeholderValues) => {
216
+ return this._prepare().run(placeholderValues);
217
+ };
218
+ all = (placeholderValues) => {
219
+ return this._prepare().all(placeholderValues);
220
+ };
221
+ get = (placeholderValues) => {
222
+ return this._prepare().get(placeholderValues);
223
+ };
224
+ values = (placeholderValues) => {
225
+ return this._prepare().values(placeholderValues);
226
+ };
227
+ async execute(placeholderValues) {
228
+ return this._prepare().execute(placeholderValues);
229
+ }
230
+ $dynamic() {
231
+ return this;
232
+ }
233
+ };
234
+ //#endregion
235
+ //#region node_modules/drizzle-orm/casing.js
236
+ function toSnakeCase(input) {
237
+ return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).map((word) => word.toLowerCase()).join("_");
238
+ }
239
+ function toCamelCase(input) {
240
+ return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).reduce((acc, word, i) => {
241
+ return acc + (i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`);
242
+ }, "");
243
+ }
244
+ function noopCase(input) {
245
+ return input;
246
+ }
247
+ var CasingCache = class {
248
+ static [entityKind] = "CasingCache";
249
+ /** @internal */
250
+ cache = {};
251
+ cachedTables = {};
252
+ convert;
253
+ constructor(casing) {
254
+ this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase;
255
+ }
256
+ getColumnCasing(column) {
257
+ if (!column.keyAsName) return column.name;
258
+ const key = `${column.table[Table.Symbol.Schema] ?? "public"}.${column.table[Table.Symbol.OriginalName]}.${column.name}`;
259
+ if (!this.cache[key]) this.cacheTable(column.table);
260
+ return this.cache[key];
261
+ }
262
+ cacheTable(table) {
263
+ const tableKey = `${table[Table.Symbol.Schema] ?? "public"}.${table[Table.Symbol.OriginalName]}`;
264
+ if (!this.cachedTables[tableKey]) {
265
+ for (const column of Object.values(table[Table.Symbol.Columns])) {
266
+ const columnKey = `${tableKey}.${column.name}`;
267
+ this.cache[columnKey] = this.convert(column.name);
268
+ }
269
+ this.cachedTables[tableKey] = true;
270
+ }
271
+ }
272
+ clearCache() {
273
+ this.cache = {};
274
+ this.cachedTables = {};
275
+ }
276
+ };
277
+ //#endregion
61
278
  //#region node_modules/drizzle-orm/errors.js
62
279
  var DrizzleError = class extends Error {
63
280
  static [entityKind] = "DrizzleError";
@@ -85,57 +302,6 @@ var TransactionRollbackError = class extends DrizzleError {
85
302
  }
86
303
  };
87
304
  //#endregion
88
- //#region node_modules/drizzle-orm/logger.js
89
- var ConsoleLogWriter = class {
90
- static [entityKind] = "ConsoleLogWriter";
91
- write(message) {
92
- console.log(message);
93
- }
94
- };
95
- var DefaultLogger = class {
96
- static [entityKind] = "DefaultLogger";
97
- writer;
98
- constructor(config) {
99
- this.writer = config?.writer ?? new ConsoleLogWriter();
100
- }
101
- logQuery(query, params) {
102
- const stringifiedParams = params.map((p) => {
103
- try {
104
- return JSON.stringify(p);
105
- } catch {
106
- return String(p);
107
- }
108
- });
109
- const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : "";
110
- this.writer.write(`Query: ${query}${paramsStr}`);
111
- }
112
- };
113
- var NoopLogger = class {
114
- static [entityKind] = "NoopLogger";
115
- logQuery() {}
116
- };
117
- //#endregion
118
- //#region node_modules/drizzle-orm/query-promise.js
119
- var QueryPromise = class {
120
- static [entityKind] = "QueryPromise";
121
- [Symbol.toStringTag] = "QueryPromise";
122
- catch(onRejected) {
123
- return this.then(void 0, onRejected);
124
- }
125
- finally(onFinally) {
126
- return this.then((value) => {
127
- onFinally?.();
128
- return value;
129
- }, (reason) => {
130
- onFinally?.();
131
- throw reason;
132
- });
133
- }
134
- then(onFulfilled, onRejected) {
135
- return this.execute().then(onFulfilled, onRejected);
136
- }
137
- };
138
- //#endregion
139
305
  //#region node_modules/drizzle-orm/pg-core/table.js
140
306
  const InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
141
307
  const EnableRLS = Symbol.for("drizzle:EnableRLS");
@@ -362,202 +528,6 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
362
528
  return result;
363
529
  }
364
530
  //#endregion
365
- //#region node_modules/drizzle-orm/selection-proxy.js
366
- var SelectionProxyHandler = class SelectionProxyHandler {
367
- static [entityKind] = "SelectionProxyHandler";
368
- config;
369
- constructor(config) {
370
- this.config = { ...config };
371
- }
372
- get(subquery, prop) {
373
- if (prop === "_") return {
374
- ...subquery["_"],
375
- selectedFields: new Proxy(subquery._.selectedFields, this)
376
- };
377
- if (prop === ViewBaseConfig) return {
378
- ...subquery[ViewBaseConfig],
379
- selectedFields: new Proxy(subquery[ViewBaseConfig].selectedFields, this)
380
- };
381
- if (typeof prop === "symbol") return subquery[prop];
382
- const value = (is(subquery, Subquery) ? subquery._.selectedFields : is(subquery, View) ? subquery[ViewBaseConfig].selectedFields : subquery)[prop];
383
- if (is(value, SQL.Aliased)) {
384
- if (this.config.sqlAliasedBehavior === "sql" && !value.isSelectionField) return value.sql;
385
- const newValue = value.clone();
386
- newValue.isSelectionField = true;
387
- return newValue;
388
- }
389
- if (is(value, SQL)) {
390
- if (this.config.sqlBehavior === "sql") return value;
391
- throw new Error(`You tried to reference "${prop}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`);
392
- }
393
- if (is(value, Column)) {
394
- if (this.config.alias) return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(value.table, new TableAliasProxyHandler(this.config.alias, this.config.replaceOriginalName ?? false))));
395
- return value;
396
- }
397
- if (typeof value !== "object" || value === null) return value;
398
- return new Proxy(value, new SelectionProxyHandler(this.config));
399
- }
400
- };
401
- //#endregion
402
- //#region node_modules/drizzle-orm/sqlite-core/utils.js
403
- function extractUsedTable(table) {
404
- if (is(table, SQLiteTable)) return [`${table[Table.Symbol.BaseName]}`];
405
- if (is(table, Subquery)) return table._.usedTables ?? [];
406
- if (is(table, SQL)) return table.usedTables ?? [];
407
- return [];
408
- }
409
- //#endregion
410
- //#region node_modules/drizzle-orm/sqlite-core/query-builders/delete.js
411
- var SQLiteDeleteBase = class extends QueryPromise {
412
- constructor(table, session, dialect, withList) {
413
- super();
414
- this.table = table;
415
- this.session = session;
416
- this.dialect = dialect;
417
- this.config = {
418
- table,
419
- withList
420
- };
421
- }
422
- static [entityKind] = "SQLiteDelete";
423
- /** @internal */
424
- config;
425
- /**
426
- * Adds a `where` clause to the query.
427
- *
428
- * Calling this method will delete only those rows that fulfill a specified condition.
429
- *
430
- * See docs: {@link https://orm.drizzle.team/docs/delete}
431
- *
432
- * @param where the `where` clause.
433
- *
434
- * @example
435
- * You can use conditional operators and `sql function` to filter the rows to be deleted.
436
- *
437
- * ```ts
438
- * // Delete all cars with green color
439
- * db.delete(cars).where(eq(cars.color, 'green'));
440
- * // or
441
- * db.delete(cars).where(sql`${cars.color} = 'green'`)
442
- * ```
443
- *
444
- * You can logically combine conditional operators with `and()` and `or()` operators:
445
- *
446
- * ```ts
447
- * // Delete all BMW cars with a green color
448
- * db.delete(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
449
- *
450
- * // Delete all cars with the green or blue color
451
- * db.delete(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
452
- * ```
453
- */
454
- where(where) {
455
- this.config.where = where;
456
- return this;
457
- }
458
- orderBy(...columns) {
459
- if (typeof columns[0] === "function") {
460
- const orderBy = columns[0](new Proxy(this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({
461
- sqlAliasedBehavior: "alias",
462
- sqlBehavior: "sql"
463
- })));
464
- const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];
465
- this.config.orderBy = orderByArray;
466
- } else {
467
- const orderByArray = columns;
468
- this.config.orderBy = orderByArray;
469
- }
470
- return this;
471
- }
472
- limit(limit) {
473
- this.config.limit = limit;
474
- return this;
475
- }
476
- returning(fields = this.table[SQLiteTable.Symbol.Columns]) {
477
- this.config.returning = orderSelectedFields(fields);
478
- return this;
479
- }
480
- /** @internal */
481
- getSQL() {
482
- return this.dialect.buildDeleteQuery(this.config);
483
- }
484
- toSQL() {
485
- const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
486
- return rest;
487
- }
488
- /** @internal */
489
- _prepare(isOneTimeQuery = true) {
490
- return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"](this.dialect.sqlToQuery(this.getSQL()), this.config.returning, this.config.returning ? "all" : "run", true, void 0, {
491
- type: "delete",
492
- tables: extractUsedTable(this.config.table)
493
- });
494
- }
495
- prepare() {
496
- return this._prepare(false);
497
- }
498
- run = (placeholderValues) => {
499
- return this._prepare().run(placeholderValues);
500
- };
501
- all = (placeholderValues) => {
502
- return this._prepare().all(placeholderValues);
503
- };
504
- get = (placeholderValues) => {
505
- return this._prepare().get(placeholderValues);
506
- };
507
- values = (placeholderValues) => {
508
- return this._prepare().values(placeholderValues);
509
- };
510
- async execute(placeholderValues) {
511
- return this._prepare().execute(placeholderValues);
512
- }
513
- $dynamic() {
514
- return this;
515
- }
516
- };
517
- //#endregion
518
- //#region node_modules/drizzle-orm/casing.js
519
- function toSnakeCase(input) {
520
- return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).map((word) => word.toLowerCase()).join("_");
521
- }
522
- function toCamelCase(input) {
523
- return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).reduce((acc, word, i) => {
524
- return acc + (i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`);
525
- }, "");
526
- }
527
- function noopCase(input) {
528
- return input;
529
- }
530
- var CasingCache = class {
531
- static [entityKind] = "CasingCache";
532
- /** @internal */
533
- cache = {};
534
- cachedTables = {};
535
- convert;
536
- constructor(casing) {
537
- this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase;
538
- }
539
- getColumnCasing(column) {
540
- if (!column.keyAsName) return column.name;
541
- const key = `${column.table[Table.Symbol.Schema] ?? "public"}.${column.table[Table.Symbol.OriginalName]}.${column.name}`;
542
- if (!this.cache[key]) this.cacheTable(column.table);
543
- return this.cache[key];
544
- }
545
- cacheTable(table) {
546
- const tableKey = `${table[Table.Symbol.Schema] ?? "public"}.${table[Table.Symbol.OriginalName]}`;
547
- if (!this.cachedTables[tableKey]) {
548
- for (const column of Object.values(table[Table.Symbol.Columns])) {
549
- const columnKey = `${tableKey}.${column.name}`;
550
- this.cache[columnKey] = this.convert(column.name);
551
- }
552
- this.cachedTables[tableKey] = true;
553
- }
554
- }
555
- clearCache() {
556
- this.cache = {};
557
- this.cachedTables = {};
558
- }
559
- };
560
- //#endregion
561
531
  //#region node_modules/drizzle-orm/sqlite-core/view-base.js
562
532
  var SQLiteViewBase = class extends View {
563
533
  static [entityKind] = "SQLiteViewBase";
@@ -2581,129 +2551,34 @@ var SQLiteTransaction = class extends BaseSQLiteDatabase {
2581
2551
  }
2582
2552
  };
2583
2553
  //#endregion
2584
- //#region node_modules/drizzle-orm/better-sqlite3/session.js
2585
- var BetterSQLiteSession = class extends SQLiteSession {
2586
- constructor(client, dialect, schema, options = {}) {
2587
- super(dialect);
2588
- this.client = client;
2589
- this.schema = schema;
2590
- this.logger = options.logger ?? new NoopLogger();
2591
- this.cache = options.cache ?? new NoopCache();
2592
- }
2593
- static [entityKind] = "BetterSQLiteSession";
2594
- logger;
2595
- cache;
2596
- prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
2597
- return new PreparedQuery(this.client.prepare(query.sql), query, this.logger, this.cache, queryMetadata, cacheConfig, fields, executeMethod, isResponseInArrayMode, customResultMapper);
2598
- }
2599
- transaction(transaction, config = {}) {
2600
- const tx = new BetterSQLiteTransaction("sync", this.dialect, this, this.schema);
2601
- return this.client.transaction(transaction)[config.behavior ?? "deferred"](tx);
2602
- }
2603
- };
2604
- var BetterSQLiteTransaction = class BetterSQLiteTransaction extends SQLiteTransaction {
2605
- static [entityKind] = "BetterSQLiteTransaction";
2606
- transaction(transaction) {
2607
- const savepointName = `sp${this.nestedIndex}`;
2608
- const tx = new BetterSQLiteTransaction("sync", this.dialect, this.session, this.schema, this.nestedIndex + 1);
2609
- this.session.run(sql.raw(`savepoint ${savepointName}`));
2610
- try {
2611
- const result = transaction(tx);
2612
- this.session.run(sql.raw(`release savepoint ${savepointName}`));
2613
- return result;
2614
- } catch (err) {
2615
- this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
2616
- throw err;
2617
- }
2554
+ //#region node_modules/drizzle-orm/logger.js
2555
+ var ConsoleLogWriter = class {
2556
+ static [entityKind] = "ConsoleLogWriter";
2557
+ write(message) {
2558
+ console.log(message);
2618
2559
  }
2619
2560
  };
2620
- var PreparedQuery = class extends SQLitePreparedQuery {
2621
- constructor(stmt, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
2622
- super("sync", executeMethod, query, cache, queryMetadata, cacheConfig);
2623
- this.stmt = stmt;
2624
- this.logger = logger;
2625
- this.fields = fields;
2626
- this._isResponseInArrayMode = _isResponseInArrayMode;
2627
- this.customResultMapper = customResultMapper;
2628
- }
2629
- static [entityKind] = "BetterSQLitePreparedQuery";
2630
- run(placeholderValues) {
2631
- const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
2632
- this.logger.logQuery(this.query.sql, params);
2633
- return this.stmt.run(...params);
2634
- }
2635
- all(placeholderValues) {
2636
- const { fields, joinsNotNullableMap, query, logger, stmt, customResultMapper } = this;
2637
- if (!fields && !customResultMapper) {
2638
- const params = fillPlaceholders(query.params, placeholderValues ?? {});
2639
- logger.logQuery(query.sql, params);
2640
- return stmt.all(...params);
2641
- }
2642
- const rows = this.values(placeholderValues);
2643
- if (customResultMapper) return customResultMapper(rows);
2644
- return rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap));
2645
- }
2646
- get(placeholderValues) {
2647
- const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
2648
- this.logger.logQuery(this.query.sql, params);
2649
- const { fields, stmt, joinsNotNullableMap, customResultMapper } = this;
2650
- if (!fields && !customResultMapper) return stmt.get(...params);
2651
- const row = stmt.raw().get(...params);
2652
- if (!row) return;
2653
- if (customResultMapper) return customResultMapper([row]);
2654
- return mapResultRow(fields, row, joinsNotNullableMap);
2655
- }
2656
- values(placeholderValues) {
2657
- const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
2658
- this.logger.logQuery(this.query.sql, params);
2659
- return this.stmt.raw().all(...params);
2561
+ var DefaultLogger = class {
2562
+ static [entityKind] = "DefaultLogger";
2563
+ writer;
2564
+ constructor(config) {
2565
+ this.writer = config?.writer ?? new ConsoleLogWriter();
2660
2566
  }
2661
- /** @internal */
2662
- isResponseInArrayMode() {
2663
- return this._isResponseInArrayMode;
2567
+ logQuery(query, params) {
2568
+ const stringifiedParams = params.map((p) => {
2569
+ try {
2570
+ return JSON.stringify(p);
2571
+ } catch {
2572
+ return String(p);
2573
+ }
2574
+ });
2575
+ const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : "";
2576
+ this.writer.write(`Query: ${query}${paramsStr}`);
2664
2577
  }
2665
2578
  };
2666
- //#endregion
2667
- //#region node_modules/drizzle-orm/better-sqlite3/driver.js
2668
- var BetterSQLite3Database = class extends BaseSQLiteDatabase {
2669
- static [entityKind] = "BetterSQLite3Database";
2579
+ var NoopLogger = class {
2580
+ static [entityKind] = "NoopLogger";
2581
+ logQuery() {}
2670
2582
  };
2671
- function construct(client, config = {}) {
2672
- const dialect = new SQLiteSyncDialect({ casing: config.casing });
2673
- let logger;
2674
- if (config.logger === true) logger = new DefaultLogger();
2675
- else if (config.logger !== false) logger = config.logger;
2676
- let schema;
2677
- if (config.schema) {
2678
- const tablesConfig = extractTablesRelationalConfig(config.schema, createTableRelationsHelpers);
2679
- schema = {
2680
- fullSchema: config.schema,
2681
- schema: tablesConfig.tables,
2682
- tableNamesMap: tablesConfig.tableNamesMap
2683
- };
2684
- }
2685
- const db = new BetterSQLite3Database("sync", dialect, new BetterSQLiteSession(client, dialect, schema, { logger }), schema);
2686
- db.$client = client;
2687
- return db;
2688
- }
2689
- function drizzle(...params) {
2690
- if (params[0] === void 0 || typeof params[0] === "string") return construct(params[0] === void 0 ? new Client() : new Client(params[0]), params[1]);
2691
- if (isConfig(params[0])) {
2692
- const { connection, client, ...drizzleConfig } = params[0];
2693
- if (client) return construct(client, drizzleConfig);
2694
- if (typeof connection === "object") {
2695
- const { source, ...options } = connection;
2696
- return construct(new Client(source, options), drizzleConfig);
2697
- }
2698
- return construct(new Client(connection), drizzleConfig);
2699
- }
2700
- return construct(params[0], params[1]);
2701
- }
2702
- ((drizzle2) => {
2703
- function mock(config) {
2704
- return construct({}, config);
2705
- }
2706
- drizzle2.mock = mock;
2707
- })(drizzle || (drizzle = {}));
2708
2583
  //#endregion
2709
- export { drizzle };
2584
+ export { SQLiteTransaction as a, SQLiteSyncDialect as c, SQLiteSession as i, createTableRelationsHelpers as l, NoopLogger as n, NoopCache as o, SQLitePreparedQuery as r, BaseSQLiteDatabase as s, DefaultLogger as t, extractTablesRelationalConfig as u };
@@ -28,10 +28,4 @@ function readMigrationFiles(config) {
28
28
  return migrationQueries;
29
29
  }
30
30
  //#endregion
31
- //#region node_modules/drizzle-orm/better-sqlite3/migrator.js
32
- function migrate(db, config) {
33
- const migrations = readMigrationFiles(config);
34
- db.dialect.migrate(migrations, db.session, config);
35
- }
36
- //#endregion
37
- export { migrate };
31
+ export { readMigrationFiles as t };
@@ -0,0 +1,8 @@
1
+ import { t as readMigrationFiles } from "./migrator-8uumkKvi.js";
2
+ //#region node_modules/drizzle-orm/better-sqlite3/migrator.js
3
+ function migrate(db, config) {
4
+ const migrations = readMigrationFiles(config);
5
+ db.dialect.migrate(migrations, db.session, config);
6
+ }
7
+ //#endregion
8
+ export { migrate };
@@ -0,0 +1,8 @@
1
+ import { t as readMigrationFiles } from "./migrator-8uumkKvi.js";
2
+ //#region node_modules/drizzle-orm/bun-sqlite/migrator.js
3
+ function migrate(db, config) {
4
+ const migrations = readMigrationFiles(config);
5
+ db.dialect.migrate(migrations, db.session, config);
6
+ }
7
+ //#endregion
8
+ export { migrate };