tempest.games 0.1.19 → 0.1.21
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/CHANGELOG.md +14 -0
- package/app/assets/index-DDZoOz6S.js +55 -0
- package/app/index.html +1 -1
- package/bin/backend.bun.js +32 -15
- package/bin/backend.worker.game.bun.js +7 -1
- package/bin/backend.worker.tribunal.bun.js +52 -13
- package/bin/frontend.bun.js +13 -6
- package/bin/setup-db.bun.js +409 -233
- package/package.json +26 -26
- package/app/assets/index-BAiC1k6g.js +0 -46
package/bin/setup-db.bun.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as os2 from "os";
|
|
6
6
|
import { resolve } from "path";
|
|
7
7
|
|
|
8
|
-
// /
|
|
8
|
+
// ../../node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/src/index.js
|
|
9
9
|
import os from "os";
|
|
10
10
|
import fs from "fs";
|
|
11
11
|
|
|
@@ -368,7 +368,7 @@ var inferType = function inferType2(x) {
|
|
|
368
368
|
var escapeBackslash = /\\/g;
|
|
369
369
|
var escapeQuote = /"/g;
|
|
370
370
|
function arrayEscape(x) {
|
|
371
|
-
return x.replace(escapeBackslash, "\\\\").replace(escapeQuote,
|
|
371
|
+
return x.replace(escapeBackslash, "\\\\").replace(escapeQuote, "\\\"");
|
|
372
372
|
}
|
|
373
373
|
var arraySerializer = function arraySerializer2(xs, serializer, options, typarray) {
|
|
374
374
|
if (Array.isArray(xs) === false)
|
|
@@ -855,7 +855,8 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
855
855
|
}
|
|
856
856
|
function queryError(query2, err) {
|
|
857
857
|
"query" in err || "parameters" in err || Object.defineProperties(err, {
|
|
858
|
-
stack: { value: err.stack + query2.origin.replace(/.*\n/,
|
|
858
|
+
stack: { value: err.stack + query2.origin.replace(/.*\n/, `
|
|
859
|
+
`), enumerable: options.debug },
|
|
859
860
|
query: { value: query2.string, enumerable: options.debug },
|
|
860
861
|
parameters: { value: query2.parameters, enumerable: options.debug },
|
|
861
862
|
args: { value: query2.args, enumerable: options.debug },
|
|
@@ -1388,7 +1389,7 @@ function Subscribe(postgres2, options) {
|
|
|
1388
1389
|
}
|
|
1389
1390
|
function pong() {
|
|
1390
1391
|
const x2 = Buffer.alloc(34);
|
|
1391
|
-
x2[0] =
|
|
1392
|
+
x2[0] = 114;
|
|
1392
1393
|
x2.fill(state2.lsn, 1);
|
|
1393
1394
|
x2.writeBigInt64BE(BigInt(Date.now() - Date.UTC(2000, 0, 1)) * BigInt(1000), 25);
|
|
1394
1395
|
stream2.write(x2);
|
|
@@ -1560,7 +1561,7 @@ function largeObject(sql, oid, mode = 131072 | 262144) {
|
|
|
1560
1561
|
});
|
|
1561
1562
|
}
|
|
1562
1563
|
|
|
1563
|
-
// /
|
|
1564
|
+
// ../../node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/src/index.js
|
|
1564
1565
|
Object.assign(Postgres, {
|
|
1565
1566
|
PostgresError,
|
|
1566
1567
|
toPascal,
|
|
@@ -1954,7 +1955,7 @@ function osUsername() {
|
|
|
1954
1955
|
}
|
|
1955
1956
|
}
|
|
1956
1957
|
|
|
1957
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
1958
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/entity.js
|
|
1958
1959
|
var entityKind = Symbol.for("drizzle:entityKind");
|
|
1959
1960
|
var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
1960
1961
|
function is(value, type) {
|
|
@@ -1979,7 +1980,7 @@ function is(value, type) {
|
|
|
1979
1980
|
return false;
|
|
1980
1981
|
}
|
|
1981
1982
|
|
|
1982
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
1983
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/logger.js
|
|
1983
1984
|
class ConsoleLogWriter {
|
|
1984
1985
|
static [entityKind] = "ConsoleLogWriter";
|
|
1985
1986
|
write(message) {
|
|
@@ -2012,7 +2013,7 @@ class NoopLogger {
|
|
|
2012
2013
|
}
|
|
2013
2014
|
}
|
|
2014
2015
|
|
|
2015
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2016
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/query-promise.js
|
|
2016
2017
|
class QueryPromise {
|
|
2017
2018
|
static [entityKind] = "QueryPromise";
|
|
2018
2019
|
[Symbol.toStringTag] = "QueryPromise";
|
|
@@ -2033,10 +2034,10 @@ class QueryPromise {
|
|
|
2033
2034
|
}
|
|
2034
2035
|
}
|
|
2035
2036
|
|
|
2036
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2037
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/table.utils.js
|
|
2037
2038
|
var TableName = Symbol.for("drizzle:Name");
|
|
2038
2039
|
|
|
2039
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2040
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/table.js
|
|
2040
2041
|
var Schema = Symbol.for("drizzle:Schema");
|
|
2041
2042
|
var Columns = Symbol.for("drizzle:Columns");
|
|
2042
2043
|
var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
@@ -2080,15 +2081,15 @@ function getTableUniqueName(table) {
|
|
|
2080
2081
|
return `${table[Schema] ?? "public"}.${table[TableName]}`;
|
|
2081
2082
|
}
|
|
2082
2083
|
|
|
2083
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2084
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/tracing-utils.js
|
|
2084
2085
|
function iife(fn, ...args) {
|
|
2085
2086
|
return fn(...args);
|
|
2086
2087
|
}
|
|
2087
2088
|
|
|
2088
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2089
|
-
var version = "0.
|
|
2089
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/version.js
|
|
2090
|
+
var version = "0.37.0";
|
|
2090
2091
|
|
|
2091
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2092
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/tracing.js
|
|
2092
2093
|
var otel;
|
|
2093
2094
|
var rawTracer;
|
|
2094
2095
|
var tracer = {
|
|
@@ -2115,7 +2116,7 @@ var tracer = {
|
|
|
2115
2116
|
}
|
|
2116
2117
|
};
|
|
2117
2118
|
|
|
2118
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2119
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/column.js
|
|
2119
2120
|
class Column {
|
|
2120
2121
|
constructor(table, config) {
|
|
2121
2122
|
this.table = table;
|
|
@@ -2165,12 +2166,12 @@ class Column {
|
|
|
2165
2166
|
}
|
|
2166
2167
|
}
|
|
2167
2168
|
|
|
2168
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2169
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
2169
2170
|
function uniqueKeyName(table, columns) {
|
|
2170
2171
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
2171
2172
|
}
|
|
2172
2173
|
|
|
2173
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2174
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
2174
2175
|
class PgColumn extends Column {
|
|
2175
2176
|
constructor(table, config) {
|
|
2176
2177
|
if (!config.uniqueName) {
|
|
@@ -2219,7 +2220,7 @@ class ExtraConfigColumn extends PgColumn {
|
|
|
2219
2220
|
}
|
|
2220
2221
|
}
|
|
2221
2222
|
|
|
2222
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2223
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
2223
2224
|
var isPgEnumSym = Symbol.for("drizzle:isPgEnum");
|
|
2224
2225
|
function isPgEnum(obj) {
|
|
2225
2226
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
|
@@ -2237,7 +2238,7 @@ class PgEnumColumn extends PgColumn {
|
|
|
2237
2238
|
}
|
|
2238
2239
|
}
|
|
2239
2240
|
|
|
2240
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2241
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/subquery.js
|
|
2241
2242
|
class Subquery {
|
|
2242
2243
|
static [entityKind] = "Subquery";
|
|
2243
2244
|
constructor(sql, selection, alias, isWith = false) {
|
|
@@ -2255,10 +2256,10 @@ class WithSubquery extends Subquery {
|
|
|
2255
2256
|
static [entityKind] = "WithSubquery";
|
|
2256
2257
|
}
|
|
2257
2258
|
|
|
2258
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2259
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/view-common.js
|
|
2259
2260
|
var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
2260
2261
|
|
|
2261
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2262
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/sql/sql.js
|
|
2262
2263
|
function isSQLWrapper(value) {
|
|
2263
2264
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
2264
2265
|
}
|
|
@@ -2362,7 +2363,11 @@ class SQL {
|
|
|
2362
2363
|
if (_config.invokeSource === "indexes") {
|
|
2363
2364
|
return { sql: escapeName(columnName), params: [] };
|
|
2364
2365
|
}
|
|
2365
|
-
|
|
2366
|
+
const schemaName = chunk.table[Table.Symbol.Schema];
|
|
2367
|
+
return {
|
|
2368
|
+
sql: chunk.table[IsAlias] || schemaName === undefined ? escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName) : escapeName(schemaName) + "." + escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName),
|
|
2369
|
+
params: []
|
|
2370
|
+
};
|
|
2366
2371
|
}
|
|
2367
2372
|
if (is(chunk, View)) {
|
|
2368
2373
|
const schemaName = chunk[ViewBaseConfig].schema;
|
|
@@ -2625,7 +2630,7 @@ Subquery.prototype.getSQL = function() {
|
|
|
2625
2630
|
return new SQL([this]);
|
|
2626
2631
|
};
|
|
2627
2632
|
|
|
2628
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2633
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/utils.js
|
|
2629
2634
|
function mapResultRow(columns, row, joinsNotNullableMap) {
|
|
2630
2635
|
const nullifyMap = {};
|
|
2631
2636
|
const result = columns.reduce((result2, { path, field }, columnIndex) => {
|
|
@@ -2699,7 +2704,7 @@ function haveSameKeys(left, right) {
|
|
|
2699
2704
|
}
|
|
2700
2705
|
function mapUpdateSet(table, values2) {
|
|
2701
2706
|
const entries = Object.entries(values2).filter(([, value]) => value !== undefined).map(([key, value]) => {
|
|
2702
|
-
if (is(value, SQL)) {
|
|
2707
|
+
if (is(value, SQL) || is(value, Column)) {
|
|
2703
2708
|
return [key, value];
|
|
2704
2709
|
} else {
|
|
2705
2710
|
return [key, new Param(value, table[Table.Symbol.Columns][key])];
|
|
@@ -2770,7 +2775,7 @@ function isConfig(data) {
|
|
|
2770
2775
|
return false;
|
|
2771
2776
|
}
|
|
2772
2777
|
|
|
2773
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2778
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/delete.js
|
|
2774
2779
|
class PgDeleteBase extends QueryPromise {
|
|
2775
2780
|
constructor(table, session, dialect, withList) {
|
|
2776
2781
|
super();
|
|
@@ -2803,98 +2808,14 @@ class PgDeleteBase extends QueryPromise {
|
|
|
2803
2808
|
prepare(name) {
|
|
2804
2809
|
return this._prepare(name);
|
|
2805
2810
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
});
|
|
2810
|
-
};
|
|
2811
|
-
$dynamic() {
|
|
2812
|
-
return this;
|
|
2813
|
-
}
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.36.1_@libsql+client-wasm@0.14.0_@types+react@18.3.12_bun-types@1.1.34_postgres@3.4.5_react@18.3.1/node_modules/drizzle-orm/pg-core/query-builders/insert.js
|
|
2817
|
-
class PgInsertBuilder {
|
|
2818
|
-
constructor(table, session, dialect, withList) {
|
|
2819
|
-
this.table = table;
|
|
2820
|
-
this.session = session;
|
|
2821
|
-
this.dialect = dialect;
|
|
2822
|
-
this.withList = withList;
|
|
2823
|
-
}
|
|
2824
|
-
static [entityKind] = "PgInsertBuilder";
|
|
2825
|
-
values(values2) {
|
|
2826
|
-
values2 = Array.isArray(values2) ? values2 : [values2];
|
|
2827
|
-
if (values2.length === 0) {
|
|
2828
|
-
throw new Error("values() must be called with at least one value");
|
|
2829
|
-
}
|
|
2830
|
-
const mappedValues = values2.map((entry) => {
|
|
2831
|
-
const result = {};
|
|
2832
|
-
const cols = this.table[Table.Symbol.Columns];
|
|
2833
|
-
for (const colKey of Object.keys(entry)) {
|
|
2834
|
-
const colValue = entry[colKey];
|
|
2835
|
-
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
|
|
2836
|
-
}
|
|
2837
|
-
return result;
|
|
2838
|
-
});
|
|
2839
|
-
return new PgInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
|
|
2840
|
-
}
|
|
2841
|
-
}
|
|
2842
|
-
|
|
2843
|
-
class PgInsertBase extends QueryPromise {
|
|
2844
|
-
constructor(table, values2, session, dialect, withList) {
|
|
2845
|
-
super();
|
|
2846
|
-
this.session = session;
|
|
2847
|
-
this.dialect = dialect;
|
|
2848
|
-
this.config = { table, values: values2, withList };
|
|
2849
|
-
}
|
|
2850
|
-
static [entityKind] = "PgInsert";
|
|
2851
|
-
config;
|
|
2852
|
-
returning(fields = this.config.table[Table.Symbol.Columns]) {
|
|
2853
|
-
this.config.returning = orderSelectedFields(fields);
|
|
2811
|
+
authToken;
|
|
2812
|
+
setToken(token) {
|
|
2813
|
+
this.authToken = token;
|
|
2854
2814
|
return this;
|
|
2855
2815
|
}
|
|
2856
|
-
onConflictDoNothing(config = {}) {
|
|
2857
|
-
if (config.target === undefined) {
|
|
2858
|
-
this.config.onConflict = sql`do nothing`;
|
|
2859
|
-
} else {
|
|
2860
|
-
let targetColumn = "";
|
|
2861
|
-
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
|
|
2862
|
-
const whereSql = config.where ? sql` where ${config.where}` : undefined;
|
|
2863
|
-
this.config.onConflict = sql`(${sql.raw(targetColumn)})${whereSql} do nothing`;
|
|
2864
|
-
}
|
|
2865
|
-
return this;
|
|
2866
|
-
}
|
|
2867
|
-
onConflictDoUpdate(config) {
|
|
2868
|
-
if (config.where && (config.targetWhere || config.setWhere)) {
|
|
2869
|
-
throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');
|
|
2870
|
-
}
|
|
2871
|
-
const whereSql = config.where ? sql` where ${config.where}` : undefined;
|
|
2872
|
-
const targetWhereSql = config.targetWhere ? sql` where ${config.targetWhere}` : undefined;
|
|
2873
|
-
const setWhereSql = config.setWhere ? sql` where ${config.setWhere}` : undefined;
|
|
2874
|
-
const setSql = this.dialect.buildUpdateSet(this.config.table, mapUpdateSet(this.config.table, config.set));
|
|
2875
|
-
let targetColumn = "";
|
|
2876
|
-
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
|
|
2877
|
-
this.config.onConflict = sql`(${sql.raw(targetColumn)})${targetWhereSql} do update set ${setSql}${whereSql}${setWhereSql}`;
|
|
2878
|
-
return this;
|
|
2879
|
-
}
|
|
2880
|
-
getSQL() {
|
|
2881
|
-
return this.dialect.buildInsertQuery(this.config);
|
|
2882
|
-
}
|
|
2883
|
-
toSQL() {
|
|
2884
|
-
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
|
|
2885
|
-
return rest;
|
|
2886
|
-
}
|
|
2887
|
-
_prepare(name) {
|
|
2888
|
-
return tracer.startActiveSpan("drizzle.prepareQuery", () => {
|
|
2889
|
-
return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, name, true);
|
|
2890
|
-
});
|
|
2891
|
-
}
|
|
2892
|
-
prepare(name) {
|
|
2893
|
-
return this._prepare(name);
|
|
2894
|
-
}
|
|
2895
2816
|
execute = (placeholderValues) => {
|
|
2896
2817
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
2897
|
-
return this._prepare().execute(placeholderValues);
|
|
2818
|
+
return this._prepare().execute(placeholderValues, this.authToken);
|
|
2898
2819
|
});
|
|
2899
2820
|
};
|
|
2900
2821
|
$dynamic() {
|
|
@@ -2902,7 +2823,7 @@ class PgInsertBase extends QueryPromise {
|
|
|
2902
2823
|
}
|
|
2903
2824
|
}
|
|
2904
2825
|
|
|
2905
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2826
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/alias.js
|
|
2906
2827
|
class ColumnAliasProxyHandler {
|
|
2907
2828
|
constructor(table) {
|
|
2908
2829
|
this.table = table;
|
|
@@ -2981,7 +2902,7 @@ function mapColumnsInSQLToAlias(query, alias) {
|
|
|
2981
2902
|
}));
|
|
2982
2903
|
}
|
|
2983
2904
|
|
|
2984
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2905
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/casing.js
|
|
2985
2906
|
function toSnakeCase(input) {
|
|
2986
2907
|
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
|
2987
2908
|
return words.map((word) => word.toLowerCase()).join("_");
|
|
@@ -3034,7 +2955,7 @@ class CasingCache {
|
|
|
3034
2955
|
}
|
|
3035
2956
|
}
|
|
3036
2957
|
|
|
3037
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2958
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/errors.js
|
|
3038
2959
|
class DrizzleError extends Error {
|
|
3039
2960
|
static [entityKind] = "DrizzleError";
|
|
3040
2961
|
constructor({ message, cause }) {
|
|
@@ -3051,7 +2972,7 @@ class TransactionRollbackError extends DrizzleError {
|
|
|
3051
2972
|
}
|
|
3052
2973
|
}
|
|
3053
2974
|
|
|
3054
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2975
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/date.js
|
|
3055
2976
|
class PgDate extends PgColumn {
|
|
3056
2977
|
static [entityKind] = "PgDate";
|
|
3057
2978
|
getSQLType() {
|
|
@@ -3071,7 +2992,7 @@ class PgDateString extends PgColumn {
|
|
|
3071
2992
|
}
|
|
3072
2993
|
}
|
|
3073
2994
|
|
|
3074
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
2995
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/json.js
|
|
3075
2996
|
class PgJson extends PgColumn {
|
|
3076
2997
|
static [entityKind] = "PgJson";
|
|
3077
2998
|
constructor(table, config) {
|
|
@@ -3095,7 +3016,7 @@ class PgJson extends PgColumn {
|
|
|
3095
3016
|
}
|
|
3096
3017
|
}
|
|
3097
3018
|
|
|
3098
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3019
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/jsonb.js
|
|
3099
3020
|
class PgJsonb extends PgColumn {
|
|
3100
3021
|
static [entityKind] = "PgJsonb";
|
|
3101
3022
|
constructor(table, config) {
|
|
@@ -3119,7 +3040,7 @@ class PgJsonb extends PgColumn {
|
|
|
3119
3040
|
}
|
|
3120
3041
|
}
|
|
3121
3042
|
|
|
3122
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3043
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
3123
3044
|
class PgNumeric extends PgColumn {
|
|
3124
3045
|
static [entityKind] = "PgNumeric";
|
|
3125
3046
|
precision;
|
|
@@ -3140,7 +3061,7 @@ class PgNumeric extends PgColumn {
|
|
|
3140
3061
|
}
|
|
3141
3062
|
}
|
|
3142
3063
|
|
|
3143
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3064
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/time.js
|
|
3144
3065
|
class PgTime extends PgColumn {
|
|
3145
3066
|
static [entityKind] = "PgTime";
|
|
3146
3067
|
withTimezone;
|
|
@@ -3156,7 +3077,7 @@ class PgTime extends PgColumn {
|
|
|
3156
3077
|
}
|
|
3157
3078
|
}
|
|
3158
3079
|
|
|
3159
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3080
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
3160
3081
|
class PgTimestamp extends PgColumn {
|
|
3161
3082
|
static [entityKind] = "PgTimestamp";
|
|
3162
3083
|
withTimezone;
|
|
@@ -3192,7 +3113,7 @@ class PgTimestampString extends PgColumn {
|
|
|
3192
3113
|
}
|
|
3193
3114
|
}
|
|
3194
3115
|
|
|
3195
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3116
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/columns/uuid.js
|
|
3196
3117
|
class PgUUID extends PgColumn {
|
|
3197
3118
|
static [entityKind] = "PgUUID";
|
|
3198
3119
|
getSQLType() {
|
|
@@ -3200,7 +3121,7 @@ class PgUUID extends PgColumn {
|
|
|
3200
3121
|
}
|
|
3201
3122
|
}
|
|
3202
3123
|
|
|
3203
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3124
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/table.js
|
|
3204
3125
|
var InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
|
|
3205
3126
|
var EnableRLS = Symbol.for("drizzle:EnableRLS");
|
|
3206
3127
|
|
|
@@ -3215,7 +3136,7 @@ class PgTable extends Table {
|
|
|
3215
3136
|
[Table.Symbol.ExtraConfigBuilder] = undefined;
|
|
3216
3137
|
}
|
|
3217
3138
|
|
|
3218
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3139
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/primary-keys.js
|
|
3219
3140
|
class PrimaryKeyBuilder {
|
|
3220
3141
|
static [entityKind] = "PgPrimaryKeyBuilder";
|
|
3221
3142
|
columns;
|
|
@@ -3243,7 +3164,7 @@ class PrimaryKey {
|
|
|
3243
3164
|
}
|
|
3244
3165
|
}
|
|
3245
3166
|
|
|
3246
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3167
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
3247
3168
|
function bindIfParam(value, column) {
|
|
3248
3169
|
if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) {
|
|
3249
3170
|
return new Param(value, column);
|
|
@@ -3348,7 +3269,7 @@ function notIlike(column, value) {
|
|
|
3348
3269
|
return sql`${column} not ilike ${value}`;
|
|
3349
3270
|
}
|
|
3350
3271
|
|
|
3351
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3272
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/sql/expressions/select.js
|
|
3352
3273
|
function asc(column) {
|
|
3353
3274
|
return sql`${column} asc`;
|
|
3354
3275
|
}
|
|
@@ -3356,7 +3277,7 @@ function desc(column) {
|
|
|
3356
3277
|
return sql`${column} desc`;
|
|
3357
3278
|
}
|
|
3358
3279
|
|
|
3359
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3280
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/relations.js
|
|
3360
3281
|
class Relation {
|
|
3361
3282
|
constructor(sourceTable, referencedTable, relationName) {
|
|
3362
3283
|
this.sourceTable = sourceTable;
|
|
@@ -3576,12 +3497,12 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
|
|
|
3576
3497
|
return result;
|
|
3577
3498
|
}
|
|
3578
3499
|
|
|
3579
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3500
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/view-base.js
|
|
3580
3501
|
class PgViewBase extends View {
|
|
3581
3502
|
static [entityKind] = "PgViewBase";
|
|
3582
3503
|
}
|
|
3583
3504
|
|
|
3584
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
3505
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/dialect.js
|
|
3585
3506
|
class PgDialect {
|
|
3586
3507
|
static [entityKind] = "PgDialect";
|
|
3587
3508
|
casing;
|
|
@@ -3617,7 +3538,7 @@ class PgDialect {
|
|
|
3617
3538
|
return `"${name}"`;
|
|
3618
3539
|
}
|
|
3619
3540
|
escapeParam(num) {
|
|
3620
|
-
return
|
|
3541
|
+
return `$${num + 1}`;
|
|
3621
3542
|
}
|
|
3622
3543
|
escapeString(str) {
|
|
3623
3544
|
return `'${str.replace(/'/g, "''")}'`;
|
|
@@ -3655,12 +3576,19 @@ class PgDialect {
|
|
|
3655
3576
|
return [res];
|
|
3656
3577
|
}));
|
|
3657
3578
|
}
|
|
3658
|
-
buildUpdateQuery({ table, set, where, returning, withList }) {
|
|
3579
|
+
buildUpdateQuery({ table, set, where, returning, withList, from, joins }) {
|
|
3659
3580
|
const withSql = this.buildWithCTE(withList);
|
|
3581
|
+
const tableName = table[PgTable.Symbol.Name];
|
|
3582
|
+
const tableSchema = table[PgTable.Symbol.Schema];
|
|
3583
|
+
const origTableName = table[PgTable.Symbol.OriginalName];
|
|
3584
|
+
const alias = tableName === origTableName ? undefined : tableName;
|
|
3585
|
+
const tableSql = sql`${tableSchema ? sql`${sql.identifier(tableSchema)}.` : undefined}${sql.identifier(origTableName)}${alias && sql` ${sql.identifier(alias)}`}`;
|
|
3660
3586
|
const setSql = this.buildUpdateSet(table, set);
|
|
3661
|
-
const
|
|
3587
|
+
const fromSql = from && sql.join([sql.raw(" from "), this.buildFromTable(from)]);
|
|
3588
|
+
const joinsSql = this.buildJoins(joins);
|
|
3589
|
+
const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: !from })}` : undefined;
|
|
3662
3590
|
const whereSql = where ? sql` where ${where}` : undefined;
|
|
3663
|
-
return sql`${withSql}update ${
|
|
3591
|
+
return sql`${withSql}update ${tableSql} set ${setSql}${fromSql}${joinsSql}${whereSql}${returningSql}`;
|
|
3664
3592
|
}
|
|
3665
3593
|
buildSelection(fields, { isSingleTable = false } = {}) {
|
|
3666
3594
|
const columnsLen = fields.length;
|
|
@@ -3697,6 +3625,48 @@ class PgDialect {
|
|
|
3697
3625
|
});
|
|
3698
3626
|
return sql.join(chunks);
|
|
3699
3627
|
}
|
|
3628
|
+
buildJoins(joins) {
|
|
3629
|
+
if (!joins || joins.length === 0) {
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
const joinsArray = [];
|
|
3633
|
+
for (const [index, joinMeta] of joins.entries()) {
|
|
3634
|
+
if (index === 0) {
|
|
3635
|
+
joinsArray.push(sql` `);
|
|
3636
|
+
}
|
|
3637
|
+
const table = joinMeta.table;
|
|
3638
|
+
const lateralSql = joinMeta.lateral ? sql` lateral` : undefined;
|
|
3639
|
+
if (is(table, PgTable)) {
|
|
3640
|
+
const tableName = table[PgTable.Symbol.Name];
|
|
3641
|
+
const tableSchema = table[PgTable.Symbol.Schema];
|
|
3642
|
+
const origTableName = table[PgTable.Symbol.OriginalName];
|
|
3643
|
+
const alias = tableName === origTableName ? undefined : joinMeta.alias;
|
|
3644
|
+
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : undefined}${sql.identifier(origTableName)}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`);
|
|
3645
|
+
} else if (is(table, View)) {
|
|
3646
|
+
const viewName = table[ViewBaseConfig].name;
|
|
3647
|
+
const viewSchema = table[ViewBaseConfig].schema;
|
|
3648
|
+
const origViewName = table[ViewBaseConfig].originalName;
|
|
3649
|
+
const alias = viewName === origViewName ? undefined : joinMeta.alias;
|
|
3650
|
+
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${viewSchema ? sql`${sql.identifier(viewSchema)}.` : undefined}${sql.identifier(origViewName)}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`);
|
|
3651
|
+
} else {
|
|
3652
|
+
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${table} on ${joinMeta.on}`);
|
|
3653
|
+
}
|
|
3654
|
+
if (index < joins.length - 1) {
|
|
3655
|
+
joinsArray.push(sql` `);
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
return sql.join(joinsArray);
|
|
3659
|
+
}
|
|
3660
|
+
buildFromTable(table) {
|
|
3661
|
+
if (is(table, Table) && table[Table.Symbol.OriginalName] !== table[Table.Symbol.Name]) {
|
|
3662
|
+
let fullName = sql`${sql.identifier(table[Table.Symbol.OriginalName])}`;
|
|
3663
|
+
if (table[Table.Symbol.Schema]) {
|
|
3664
|
+
fullName = sql`${sql.identifier(table[Table.Symbol.Schema])}.${fullName}`;
|
|
3665
|
+
}
|
|
3666
|
+
return sql`${fullName} ${sql.identifier(table[Table.Symbol.Name])}`;
|
|
3667
|
+
}
|
|
3668
|
+
return table;
|
|
3669
|
+
}
|
|
3700
3670
|
buildSelectQuery({
|
|
3701
3671
|
withList,
|
|
3702
3672
|
fields,
|
|
@@ -3727,45 +3697,8 @@ class PgDialect {
|
|
|
3727
3697
|
distinctSql = distinct === true ? sql` distinct` : sql` distinct on (${sql.join(distinct.on, sql`, `)})`;
|
|
3728
3698
|
}
|
|
3729
3699
|
const selection = this.buildSelection(fieldsList, { isSingleTable });
|
|
3730
|
-
const tableSql = (
|
|
3731
|
-
|
|
3732
|
-
let fullName = sql`${sql.identifier(table[Table.Symbol.OriginalName])}`;
|
|
3733
|
-
if (table[Table.Symbol.Schema]) {
|
|
3734
|
-
fullName = sql`${sql.identifier(table[Table.Symbol.Schema])}.${fullName}`;
|
|
3735
|
-
}
|
|
3736
|
-
return sql`${fullName} ${sql.identifier(table[Table.Symbol.Name])}`;
|
|
3737
|
-
}
|
|
3738
|
-
return table;
|
|
3739
|
-
})();
|
|
3740
|
-
const joinsArray = [];
|
|
3741
|
-
if (joins) {
|
|
3742
|
-
for (const [index, joinMeta] of joins.entries()) {
|
|
3743
|
-
if (index === 0) {
|
|
3744
|
-
joinsArray.push(sql` `);
|
|
3745
|
-
}
|
|
3746
|
-
const table2 = joinMeta.table;
|
|
3747
|
-
const lateralSql = joinMeta.lateral ? sql` lateral` : undefined;
|
|
3748
|
-
if (is(table2, PgTable)) {
|
|
3749
|
-
const tableName = table2[PgTable.Symbol.Name];
|
|
3750
|
-
const tableSchema = table2[PgTable.Symbol.Schema];
|
|
3751
|
-
const origTableName = table2[PgTable.Symbol.OriginalName];
|
|
3752
|
-
const alias = tableName === origTableName ? undefined : joinMeta.alias;
|
|
3753
|
-
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : undefined}${sql.identifier(origTableName)}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`);
|
|
3754
|
-
} else if (is(table2, View)) {
|
|
3755
|
-
const viewName = table2[ViewBaseConfig].name;
|
|
3756
|
-
const viewSchema = table2[ViewBaseConfig].schema;
|
|
3757
|
-
const origViewName = table2[ViewBaseConfig].originalName;
|
|
3758
|
-
const alias = viewName === origViewName ? undefined : joinMeta.alias;
|
|
3759
|
-
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${viewSchema ? sql`${sql.identifier(viewSchema)}.` : undefined}${sql.identifier(origViewName)}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`);
|
|
3760
|
-
} else {
|
|
3761
|
-
joinsArray.push(sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${table2} on ${joinMeta.on}`);
|
|
3762
|
-
}
|
|
3763
|
-
if (index < joins.length - 1) {
|
|
3764
|
-
joinsArray.push(sql` `);
|
|
3765
|
-
}
|
|
3766
|
-
}
|
|
3767
|
-
}
|
|
3768
|
-
const joinsSql = sql.join(joinsArray);
|
|
3700
|
+
const tableSql = this.buildFromTable(table);
|
|
3701
|
+
const joinsSql = this.buildJoins(joins);
|
|
3769
3702
|
const whereSql = where ? sql` where ${where}` : undefined;
|
|
3770
3703
|
const havingSql = having ? sql` having ${having}` : undefined;
|
|
3771
3704
|
let orderBySql;
|
|
@@ -3838,41 +3771,53 @@ class PgDialect {
|
|
|
3838
3771
|
const offsetSql = offset ? sql` offset ${offset}` : undefined;
|
|
3839
3772
|
return sql`${leftChunk}${operatorChunk}${rightChunk}${orderBySql}${limitSql}${offsetSql}`;
|
|
3840
3773
|
}
|
|
3841
|
-
buildInsertQuery({ table, values:
|
|
3774
|
+
buildInsertQuery({ table, values: valuesOrSelect, onConflict, returning, withList, select: select2, overridingSystemValue_ }) {
|
|
3842
3775
|
const valuesSqlList = [];
|
|
3843
3776
|
const columns = table[Table.Symbol.Columns];
|
|
3844
3777
|
const colEntries = Object.entries(columns).filter(([_, col]) => !col.shouldDisableInsert());
|
|
3845
3778
|
const insertOrder = colEntries.map(([, column]) => sql.identifier(this.casing.getColumnCasing(column)));
|
|
3846
|
-
|
|
3847
|
-
const
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3779
|
+
if (select2) {
|
|
3780
|
+
const select22 = valuesOrSelect;
|
|
3781
|
+
if (is(select22, SQL)) {
|
|
3782
|
+
valuesSqlList.push(select22);
|
|
3783
|
+
} else {
|
|
3784
|
+
valuesSqlList.push(select22.getSQL());
|
|
3785
|
+
}
|
|
3786
|
+
} else {
|
|
3787
|
+
const values2 = valuesOrSelect;
|
|
3788
|
+
valuesSqlList.push(sql.raw("values "));
|
|
3789
|
+
for (const [valueIndex, value] of values2.entries()) {
|
|
3790
|
+
const valueList = [];
|
|
3791
|
+
for (const [fieldName, col] of colEntries) {
|
|
3792
|
+
const colValue = value[fieldName];
|
|
3793
|
+
if (colValue === undefined || is(colValue, Param) && colValue.value === undefined) {
|
|
3794
|
+
if (col.defaultFn !== undefined) {
|
|
3795
|
+
const defaultFnResult = col.defaultFn();
|
|
3796
|
+
const defaultValue = is(defaultFnResult, SQL) ? defaultFnResult : sql.param(defaultFnResult, col);
|
|
3797
|
+
valueList.push(defaultValue);
|
|
3798
|
+
} else if (!col.default && col.onUpdateFn !== undefined) {
|
|
3799
|
+
const onUpdateFnResult = col.onUpdateFn();
|
|
3800
|
+
const newValue = is(onUpdateFnResult, SQL) ? onUpdateFnResult : sql.param(onUpdateFnResult, col);
|
|
3801
|
+
valueList.push(newValue);
|
|
3802
|
+
} else {
|
|
3803
|
+
valueList.push(sql`default`);
|
|
3804
|
+
}
|
|
3859
3805
|
} else {
|
|
3860
|
-
valueList.push(
|
|
3806
|
+
valueList.push(colValue);
|
|
3861
3807
|
}
|
|
3862
|
-
} else {
|
|
3863
|
-
valueList.push(colValue);
|
|
3864
3808
|
}
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3809
|
+
valuesSqlList.push(valueList);
|
|
3810
|
+
if (valueIndex < values2.length - 1) {
|
|
3811
|
+
valuesSqlList.push(sql`, `);
|
|
3812
|
+
}
|
|
3869
3813
|
}
|
|
3870
3814
|
}
|
|
3871
3815
|
const withSql = this.buildWithCTE(withList);
|
|
3872
3816
|
const valuesSql = sql.join(valuesSqlList);
|
|
3873
3817
|
const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : undefined;
|
|
3874
3818
|
const onConflictSql = onConflict ? sql` on conflict ${onConflict}` : undefined;
|
|
3875
|
-
|
|
3819
|
+
const overridingSql = overridingSystemValue_ === true ? sql`overriding system value ` : undefined;
|
|
3820
|
+
return sql`${withSql}insert into ${table} ${insertOrder} ${overridingSql}${valuesSql}${onConflictSql}${returningSql}`;
|
|
3876
3821
|
}
|
|
3877
3822
|
buildRefreshMaterializedViewQuery({ view, concurrently, withNoData }) {
|
|
3878
3823
|
const concurrentlySql = concurrently ? sql` concurrently` : undefined;
|
|
@@ -4114,7 +4059,7 @@ class PgDialect {
|
|
|
4114
4059
|
}
|
|
4115
4060
|
}
|
|
4116
4061
|
|
|
4117
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4062
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/selection-proxy.js
|
|
4118
4063
|
class SelectionProxyHandler {
|
|
4119
4064
|
static [entityKind] = "SelectionProxyHandler";
|
|
4120
4065
|
config;
|
|
@@ -4166,7 +4111,7 @@ class SelectionProxyHandler {
|
|
|
4166
4111
|
}
|
|
4167
4112
|
}
|
|
4168
4113
|
|
|
4169
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4114
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/query-builders/query-builder.js
|
|
4170
4115
|
class TypedQueryBuilder {
|
|
4171
4116
|
static [entityKind] = "TypedQueryBuilder";
|
|
4172
4117
|
getSelectedFields() {
|
|
@@ -4174,7 +4119,7 @@ class TypedQueryBuilder {
|
|
|
4174
4119
|
}
|
|
4175
4120
|
}
|
|
4176
4121
|
|
|
4177
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4122
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/select.js
|
|
4178
4123
|
class PgSelectBuilder {
|
|
4179
4124
|
static [entityKind] = "PgSelectBuilder";
|
|
4180
4125
|
fields;
|
|
@@ -4191,6 +4136,11 @@ class PgSelectBuilder {
|
|
|
4191
4136
|
}
|
|
4192
4137
|
this.distinct = config.distinct;
|
|
4193
4138
|
}
|
|
4139
|
+
authToken;
|
|
4140
|
+
setToken(token) {
|
|
4141
|
+
this.authToken = token;
|
|
4142
|
+
return this;
|
|
4143
|
+
}
|
|
4194
4144
|
from(source) {
|
|
4195
4145
|
const isPartialSelect = !!this.fields;
|
|
4196
4146
|
let fields;
|
|
@@ -4213,7 +4163,7 @@ class PgSelectBuilder {
|
|
|
4213
4163
|
dialect: this.dialect,
|
|
4214
4164
|
withList: this.withList,
|
|
4215
4165
|
distinct: this.distinct
|
|
4216
|
-
});
|
|
4166
|
+
}).setToken(this.authToken);
|
|
4217
4167
|
}
|
|
4218
4168
|
}
|
|
4219
4169
|
|
|
@@ -4401,7 +4351,7 @@ class PgSelectQueryBuilderBase extends TypedQueryBuilder {
|
|
|
4401
4351
|
class PgSelectBase extends PgSelectQueryBuilderBase {
|
|
4402
4352
|
static [entityKind] = "PgSelect";
|
|
4403
4353
|
_prepare(name) {
|
|
4404
|
-
const { session, config, dialect, joinsNotNullableMap } = this;
|
|
4354
|
+
const { session, config, dialect, joinsNotNullableMap, authToken } = this;
|
|
4405
4355
|
if (!session) {
|
|
4406
4356
|
throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");
|
|
4407
4357
|
}
|
|
@@ -4409,15 +4359,20 @@ class PgSelectBase extends PgSelectQueryBuilderBase {
|
|
|
4409
4359
|
const fieldsList = orderSelectedFields(config.fields);
|
|
4410
4360
|
const query = session.prepareQuery(dialect.sqlToQuery(this.getSQL()), fieldsList, name, true);
|
|
4411
4361
|
query.joinsNotNullableMap = joinsNotNullableMap;
|
|
4412
|
-
return query;
|
|
4362
|
+
return query.setToken(authToken);
|
|
4413
4363
|
});
|
|
4414
4364
|
}
|
|
4415
4365
|
prepare(name) {
|
|
4416
4366
|
return this._prepare(name);
|
|
4417
4367
|
}
|
|
4368
|
+
authToken;
|
|
4369
|
+
setToken(token) {
|
|
4370
|
+
this.authToken = token;
|
|
4371
|
+
return this;
|
|
4372
|
+
}
|
|
4418
4373
|
execute = (placeholderValues) => {
|
|
4419
4374
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
4420
|
-
return this._prepare().execute(placeholderValues);
|
|
4375
|
+
return this._prepare().execute(placeholderValues, this.authToken);
|
|
4421
4376
|
});
|
|
4422
4377
|
};
|
|
4423
4378
|
}
|
|
@@ -4452,7 +4407,7 @@ var intersectAll = createSetOperator("intersect", true);
|
|
|
4452
4407
|
var except = createSetOperator("except", false);
|
|
4453
4408
|
var exceptAll = createSetOperator("except", true);
|
|
4454
4409
|
|
|
4455
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4410
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
|
|
4456
4411
|
class QueryBuilder {
|
|
4457
4412
|
static [entityKind] = "PgQueryBuilder";
|
|
4458
4413
|
dialect;
|
|
@@ -4531,7 +4486,118 @@ class QueryBuilder {
|
|
|
4531
4486
|
}
|
|
4532
4487
|
}
|
|
4533
4488
|
|
|
4534
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4489
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/insert.js
|
|
4490
|
+
class PgInsertBuilder {
|
|
4491
|
+
constructor(table, session, dialect, withList, overridingSystemValue_) {
|
|
4492
|
+
this.table = table;
|
|
4493
|
+
this.session = session;
|
|
4494
|
+
this.dialect = dialect;
|
|
4495
|
+
this.withList = withList;
|
|
4496
|
+
this.overridingSystemValue_ = overridingSystemValue_;
|
|
4497
|
+
}
|
|
4498
|
+
static [entityKind] = "PgInsertBuilder";
|
|
4499
|
+
authToken;
|
|
4500
|
+
setToken(token) {
|
|
4501
|
+
this.authToken = token;
|
|
4502
|
+
return this;
|
|
4503
|
+
}
|
|
4504
|
+
overridingSystemValue() {
|
|
4505
|
+
this.overridingSystemValue_ = true;
|
|
4506
|
+
return this;
|
|
4507
|
+
}
|
|
4508
|
+
values(values2) {
|
|
4509
|
+
values2 = Array.isArray(values2) ? values2 : [values2];
|
|
4510
|
+
if (values2.length === 0) {
|
|
4511
|
+
throw new Error("values() must be called with at least one value");
|
|
4512
|
+
}
|
|
4513
|
+
const mappedValues = values2.map((entry) => {
|
|
4514
|
+
const result = {};
|
|
4515
|
+
const cols = this.table[Table.Symbol.Columns];
|
|
4516
|
+
for (const colKey of Object.keys(entry)) {
|
|
4517
|
+
const colValue = entry[colKey];
|
|
4518
|
+
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
|
|
4519
|
+
}
|
|
4520
|
+
return result;
|
|
4521
|
+
});
|
|
4522
|
+
return new PgInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList, false, this.overridingSystemValue_).setToken(this.authToken);
|
|
4523
|
+
}
|
|
4524
|
+
select(selectQuery) {
|
|
4525
|
+
const select2 = typeof selectQuery === "function" ? selectQuery(new QueryBuilder) : selectQuery;
|
|
4526
|
+
if (!is(select2, SQL) && !haveSameKeys(this.table[Columns], select2._.selectedFields)) {
|
|
4527
|
+
throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");
|
|
4528
|
+
}
|
|
4529
|
+
return new PgInsertBase(this.table, select2, this.session, this.dialect, this.withList, true);
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
class PgInsertBase extends QueryPromise {
|
|
4534
|
+
constructor(table, values2, session, dialect, withList, select2, overridingSystemValue_) {
|
|
4535
|
+
super();
|
|
4536
|
+
this.session = session;
|
|
4537
|
+
this.dialect = dialect;
|
|
4538
|
+
this.config = { table, values: values2, withList, select: select2, overridingSystemValue_ };
|
|
4539
|
+
}
|
|
4540
|
+
static [entityKind] = "PgInsert";
|
|
4541
|
+
config;
|
|
4542
|
+
returning(fields = this.config.table[Table.Symbol.Columns]) {
|
|
4543
|
+
this.config.returning = orderSelectedFields(fields);
|
|
4544
|
+
return this;
|
|
4545
|
+
}
|
|
4546
|
+
onConflictDoNothing(config = {}) {
|
|
4547
|
+
if (config.target === undefined) {
|
|
4548
|
+
this.config.onConflict = sql`do nothing`;
|
|
4549
|
+
} else {
|
|
4550
|
+
let targetColumn = "";
|
|
4551
|
+
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
|
|
4552
|
+
const whereSql = config.where ? sql` where ${config.where}` : undefined;
|
|
4553
|
+
this.config.onConflict = sql`(${sql.raw(targetColumn)})${whereSql} do nothing`;
|
|
4554
|
+
}
|
|
4555
|
+
return this;
|
|
4556
|
+
}
|
|
4557
|
+
onConflictDoUpdate(config) {
|
|
4558
|
+
if (config.where && (config.targetWhere || config.setWhere)) {
|
|
4559
|
+
throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');
|
|
4560
|
+
}
|
|
4561
|
+
const whereSql = config.where ? sql` where ${config.where}` : undefined;
|
|
4562
|
+
const targetWhereSql = config.targetWhere ? sql` where ${config.targetWhere}` : undefined;
|
|
4563
|
+
const setWhereSql = config.setWhere ? sql` where ${config.setWhere}` : undefined;
|
|
4564
|
+
const setSql = this.dialect.buildUpdateSet(this.config.table, mapUpdateSet(this.config.table, config.set));
|
|
4565
|
+
let targetColumn = "";
|
|
4566
|
+
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
|
|
4567
|
+
this.config.onConflict = sql`(${sql.raw(targetColumn)})${targetWhereSql} do update set ${setSql}${whereSql}${setWhereSql}`;
|
|
4568
|
+
return this;
|
|
4569
|
+
}
|
|
4570
|
+
getSQL() {
|
|
4571
|
+
return this.dialect.buildInsertQuery(this.config);
|
|
4572
|
+
}
|
|
4573
|
+
toSQL() {
|
|
4574
|
+
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
|
|
4575
|
+
return rest;
|
|
4576
|
+
}
|
|
4577
|
+
_prepare(name) {
|
|
4578
|
+
return tracer.startActiveSpan("drizzle.prepareQuery", () => {
|
|
4579
|
+
return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, name, true);
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
prepare(name) {
|
|
4583
|
+
return this._prepare(name);
|
|
4584
|
+
}
|
|
4585
|
+
authToken;
|
|
4586
|
+
setToken(token) {
|
|
4587
|
+
this.authToken = token;
|
|
4588
|
+
return this;
|
|
4589
|
+
}
|
|
4590
|
+
execute = (placeholderValues) => {
|
|
4591
|
+
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
4592
|
+
return this._prepare().execute(placeholderValues, this.authToken);
|
|
4593
|
+
});
|
|
4594
|
+
};
|
|
4595
|
+
$dynamic() {
|
|
4596
|
+
return this;
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
|
|
4600
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
|
|
4535
4601
|
class PgRefreshMaterializedView extends QueryPromise {
|
|
4536
4602
|
constructor(view, session, dialect) {
|
|
4537
4603
|
super();
|
|
@@ -4570,14 +4636,19 @@ class PgRefreshMaterializedView extends QueryPromise {
|
|
|
4570
4636
|
prepare(name) {
|
|
4571
4637
|
return this._prepare(name);
|
|
4572
4638
|
}
|
|
4639
|
+
authToken;
|
|
4640
|
+
setToken(token) {
|
|
4641
|
+
this.authToken = token;
|
|
4642
|
+
return this;
|
|
4643
|
+
}
|
|
4573
4644
|
execute = (placeholderValues) => {
|
|
4574
4645
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
4575
|
-
return this._prepare().execute(placeholderValues);
|
|
4646
|
+
return this._prepare().execute(placeholderValues, this.authToken);
|
|
4576
4647
|
});
|
|
4577
4648
|
};
|
|
4578
4649
|
}
|
|
4579
4650
|
|
|
4580
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4651
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/update.js
|
|
4581
4652
|
class PgUpdateBuilder {
|
|
4582
4653
|
constructor(table, session, dialect, withList) {
|
|
4583
4654
|
this.table = table;
|
|
@@ -4586,8 +4657,13 @@ class PgUpdateBuilder {
|
|
|
4586
4657
|
this.withList = withList;
|
|
4587
4658
|
}
|
|
4588
4659
|
static [entityKind] = "PgUpdateBuilder";
|
|
4660
|
+
authToken;
|
|
4661
|
+
setToken(token) {
|
|
4662
|
+
this.authToken = token;
|
|
4663
|
+
return this;
|
|
4664
|
+
}
|
|
4589
4665
|
set(values2) {
|
|
4590
|
-
return new PgUpdateBase(this.table, mapUpdateSet(this.table, values2), this.session, this.dialect, this.withList);
|
|
4666
|
+
return new PgUpdateBase(this.table, mapUpdateSet(this.table, values2), this.session, this.dialect, this.withList).setToken(this.authToken);
|
|
4591
4667
|
}
|
|
4592
4668
|
}
|
|
4593
4669
|
|
|
@@ -4596,15 +4672,92 @@ class PgUpdateBase extends QueryPromise {
|
|
|
4596
4672
|
super();
|
|
4597
4673
|
this.session = session;
|
|
4598
4674
|
this.dialect = dialect;
|
|
4599
|
-
this.config = { set, table, withList };
|
|
4675
|
+
this.config = { set, table, withList, joins: [] };
|
|
4676
|
+
this.tableName = getTableLikeName(table);
|
|
4677
|
+
this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
|
|
4600
4678
|
}
|
|
4601
4679
|
static [entityKind] = "PgUpdate";
|
|
4602
4680
|
config;
|
|
4681
|
+
tableName;
|
|
4682
|
+
joinsNotNullableMap;
|
|
4683
|
+
from(source) {
|
|
4684
|
+
const tableName = getTableLikeName(source);
|
|
4685
|
+
if (typeof tableName === "string") {
|
|
4686
|
+
this.joinsNotNullableMap[tableName] = true;
|
|
4687
|
+
}
|
|
4688
|
+
this.config.from = source;
|
|
4689
|
+
return this;
|
|
4690
|
+
}
|
|
4691
|
+
getTableLikeFields(table) {
|
|
4692
|
+
if (is(table, PgTable)) {
|
|
4693
|
+
return table[Table.Symbol.Columns];
|
|
4694
|
+
} else if (is(table, Subquery)) {
|
|
4695
|
+
return table._.selectedFields;
|
|
4696
|
+
}
|
|
4697
|
+
return table[ViewBaseConfig].selectedFields;
|
|
4698
|
+
}
|
|
4699
|
+
createJoin(joinType) {
|
|
4700
|
+
return (table, on) => {
|
|
4701
|
+
const tableName = getTableLikeName(table);
|
|
4702
|
+
if (typeof tableName === "string" && this.config.joins.some((join) => join.alias === tableName)) {
|
|
4703
|
+
throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
4704
|
+
}
|
|
4705
|
+
if (typeof on === "function") {
|
|
4706
|
+
const from = this.config.from && !is(this.config.from, SQL) ? this.getTableLikeFields(this.config.from) : undefined;
|
|
4707
|
+
on = on(new Proxy(this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })), from && new Proxy(from, new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })));
|
|
4708
|
+
}
|
|
4709
|
+
this.config.joins.push({ on, table, joinType, alias: tableName });
|
|
4710
|
+
if (typeof tableName === "string") {
|
|
4711
|
+
switch (joinType) {
|
|
4712
|
+
case "left": {
|
|
4713
|
+
this.joinsNotNullableMap[tableName] = false;
|
|
4714
|
+
break;
|
|
4715
|
+
}
|
|
4716
|
+
case "right": {
|
|
4717
|
+
this.joinsNotNullableMap = Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]));
|
|
4718
|
+
this.joinsNotNullableMap[tableName] = true;
|
|
4719
|
+
break;
|
|
4720
|
+
}
|
|
4721
|
+
case "inner": {
|
|
4722
|
+
this.joinsNotNullableMap[tableName] = true;
|
|
4723
|
+
break;
|
|
4724
|
+
}
|
|
4725
|
+
case "full": {
|
|
4726
|
+
this.joinsNotNullableMap = Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]));
|
|
4727
|
+
this.joinsNotNullableMap[tableName] = false;
|
|
4728
|
+
break;
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
return this;
|
|
4733
|
+
};
|
|
4734
|
+
}
|
|
4735
|
+
leftJoin = this.createJoin("left");
|
|
4736
|
+
rightJoin = this.createJoin("right");
|
|
4737
|
+
innerJoin = this.createJoin("inner");
|
|
4738
|
+
fullJoin = this.createJoin("full");
|
|
4603
4739
|
where(where) {
|
|
4604
4740
|
this.config.where = where;
|
|
4605
4741
|
return this;
|
|
4606
4742
|
}
|
|
4607
|
-
returning(fields
|
|
4743
|
+
returning(fields) {
|
|
4744
|
+
if (!fields) {
|
|
4745
|
+
fields = Object.assign({}, this.config.table[Table.Symbol.Columns]);
|
|
4746
|
+
if (this.config.from) {
|
|
4747
|
+
const tableName = getTableLikeName(this.config.from);
|
|
4748
|
+
if (typeof tableName === "string" && this.config.from && !is(this.config.from, SQL)) {
|
|
4749
|
+
const fromFields = this.getTableLikeFields(this.config.from);
|
|
4750
|
+
fields[tableName] = fromFields;
|
|
4751
|
+
}
|
|
4752
|
+
for (const join of this.config.joins) {
|
|
4753
|
+
const tableName2 = getTableLikeName(join.table);
|
|
4754
|
+
if (typeof tableName2 === "string" && !is(join.table, SQL)) {
|
|
4755
|
+
const fromFields = this.getTableLikeFields(join.table);
|
|
4756
|
+
fields[tableName2] = fromFields;
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4608
4761
|
this.config.returning = orderSelectedFields(fields);
|
|
4609
4762
|
return this;
|
|
4610
4763
|
}
|
|
@@ -4616,20 +4769,27 @@ class PgUpdateBase extends QueryPromise {
|
|
|
4616
4769
|
return rest;
|
|
4617
4770
|
}
|
|
4618
4771
|
_prepare(name) {
|
|
4619
|
-
|
|
4772
|
+
const query = this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, name, true);
|
|
4773
|
+
query.joinsNotNullableMap = this.joinsNotNullableMap;
|
|
4774
|
+
return query;
|
|
4620
4775
|
}
|
|
4621
4776
|
prepare(name) {
|
|
4622
4777
|
return this._prepare(name);
|
|
4623
4778
|
}
|
|
4779
|
+
authToken;
|
|
4780
|
+
setToken(token) {
|
|
4781
|
+
this.authToken = token;
|
|
4782
|
+
return this;
|
|
4783
|
+
}
|
|
4624
4784
|
execute = (placeholderValues) => {
|
|
4625
|
-
return this._prepare().execute(placeholderValues);
|
|
4785
|
+
return this._prepare().execute(placeholderValues, this.authToken);
|
|
4626
4786
|
};
|
|
4627
4787
|
$dynamic() {
|
|
4628
4788
|
return this;
|
|
4629
4789
|
}
|
|
4630
4790
|
}
|
|
4631
4791
|
|
|
4632
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4792
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/count.js
|
|
4633
4793
|
class PgCountBuilder extends SQL {
|
|
4634
4794
|
constructor(params) {
|
|
4635
4795
|
super(PgCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
|
@@ -4639,6 +4799,7 @@ class PgCountBuilder extends SQL {
|
|
|
4639
4799
|
this.sql = PgCountBuilder.buildCount(params.source, params.filters);
|
|
4640
4800
|
}
|
|
4641
4801
|
sql;
|
|
4802
|
+
token;
|
|
4642
4803
|
static [entityKind] = "PgCountBuilder";
|
|
4643
4804
|
[Symbol.toStringTag] = "PgCountBuilder";
|
|
4644
4805
|
session;
|
|
@@ -4648,8 +4809,12 @@ class PgCountBuilder extends SQL {
|
|
|
4648
4809
|
static buildCount(source, filters) {
|
|
4649
4810
|
return sql`select count(*) as count from ${source}${sql.raw(" where ").if(filters)}${filters};`;
|
|
4650
4811
|
}
|
|
4812
|
+
setToken(token) {
|
|
4813
|
+
this.token = token;
|
|
4814
|
+
return this;
|
|
4815
|
+
}
|
|
4651
4816
|
then(onfulfilled, onrejected) {
|
|
4652
|
-
return Promise.resolve(this.session.count(this.sql)).then(onfulfilled, onrejected);
|
|
4817
|
+
return Promise.resolve(this.session.count(this.sql, this.token)).then(onfulfilled, onrejected);
|
|
4653
4818
|
}
|
|
4654
4819
|
catch(onRejected) {
|
|
4655
4820
|
return this.then(undefined, onRejected);
|
|
@@ -4665,7 +4830,7 @@ class PgCountBuilder extends SQL {
|
|
|
4665
4830
|
}
|
|
4666
4831
|
}
|
|
4667
4832
|
|
|
4668
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4833
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/query.js
|
|
4669
4834
|
class RelationalQueryBuilder {
|
|
4670
4835
|
constructor(fullSchema, schema, tableNamesMap, table, tableConfig, dialect, session) {
|
|
4671
4836
|
this.fullSchema = fullSchema;
|
|
@@ -4736,14 +4901,19 @@ class PgRelationalQuery extends QueryPromise {
|
|
|
4736
4901
|
toSQL() {
|
|
4737
4902
|
return this._toSQL().builtQuery;
|
|
4738
4903
|
}
|
|
4904
|
+
authToken;
|
|
4905
|
+
setToken(token) {
|
|
4906
|
+
this.authToken = token;
|
|
4907
|
+
return this;
|
|
4908
|
+
}
|
|
4739
4909
|
execute() {
|
|
4740
4910
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
4741
|
-
return this._prepare().execute();
|
|
4911
|
+
return this._prepare().execute(undefined, this.authToken);
|
|
4742
4912
|
});
|
|
4743
4913
|
}
|
|
4744
4914
|
}
|
|
4745
4915
|
|
|
4746
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4916
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/query-builders/raw.js
|
|
4747
4917
|
class PgRaw extends QueryPromise {
|
|
4748
4918
|
constructor(execute, sql2, query, mapBatchResult) {
|
|
4749
4919
|
super();
|
|
@@ -4770,7 +4940,7 @@ class PgRaw extends QueryPromise {
|
|
|
4770
4940
|
}
|
|
4771
4941
|
}
|
|
4772
4942
|
|
|
4773
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
4943
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/db.js
|
|
4774
4944
|
class PgDatabase {
|
|
4775
4945
|
constructor(dialect, session, schema) {
|
|
4776
4946
|
this.dialect = dialect;
|
|
@@ -4883,28 +5053,34 @@ class PgDatabase {
|
|
|
4883
5053
|
refreshMaterializedView(view) {
|
|
4884
5054
|
return new PgRefreshMaterializedView(view, this.session, this.dialect);
|
|
4885
5055
|
}
|
|
5056
|
+
authToken;
|
|
4886
5057
|
execute(query) {
|
|
4887
5058
|
const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL();
|
|
4888
5059
|
const builtQuery = this.dialect.sqlToQuery(sequel);
|
|
4889
5060
|
const prepared = this.session.prepareQuery(builtQuery, undefined, undefined, false);
|
|
4890
|
-
return new PgRaw(() => prepared.execute(), sequel, builtQuery, (result) => prepared.mapResult(result, true));
|
|
5061
|
+
return new PgRaw(() => prepared.execute(undefined, this.authToken), sequel, builtQuery, (result) => prepared.mapResult(result, true));
|
|
4891
5062
|
}
|
|
4892
5063
|
transaction(transaction, config) {
|
|
4893
5064
|
return this.session.transaction(transaction, config);
|
|
4894
5065
|
}
|
|
4895
5066
|
}
|
|
4896
5067
|
|
|
4897
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
5068
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/pg-core/session.js
|
|
4898
5069
|
class PgPreparedQuery {
|
|
4899
5070
|
constructor(query) {
|
|
4900
5071
|
this.query = query;
|
|
4901
5072
|
}
|
|
5073
|
+
authToken;
|
|
4902
5074
|
getQuery() {
|
|
4903
5075
|
return this.query;
|
|
4904
5076
|
}
|
|
4905
5077
|
mapResult(response, _isFromBatch) {
|
|
4906
5078
|
return response;
|
|
4907
5079
|
}
|
|
5080
|
+
setToken(token) {
|
|
5081
|
+
this.authToken = token;
|
|
5082
|
+
return this;
|
|
5083
|
+
}
|
|
4908
5084
|
static [entityKind] = "PgPreparedQuery";
|
|
4909
5085
|
joinsNotNullableMap;
|
|
4910
5086
|
}
|
|
@@ -4914,19 +5090,19 @@ class PgSession {
|
|
|
4914
5090
|
this.dialect = dialect;
|
|
4915
5091
|
}
|
|
4916
5092
|
static [entityKind] = "PgSession";
|
|
4917
|
-
execute(query) {
|
|
5093
|
+
execute(query, token) {
|
|
4918
5094
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
|
4919
5095
|
const prepared = tracer.startActiveSpan("drizzle.prepareQuery", () => {
|
|
4920
5096
|
return this.prepareQuery(this.dialect.sqlToQuery(query), undefined, undefined, false);
|
|
4921
5097
|
});
|
|
4922
|
-
return prepared.execute();
|
|
5098
|
+
return prepared.setToken(token).execute(undefined, token);
|
|
4923
5099
|
});
|
|
4924
5100
|
}
|
|
4925
5101
|
all(query) {
|
|
4926
5102
|
return this.prepareQuery(this.dialect.sqlToQuery(query), undefined, undefined, false).all();
|
|
4927
5103
|
}
|
|
4928
|
-
async count(sql2) {
|
|
4929
|
-
const res = await this.execute(sql2);
|
|
5104
|
+
async count(sql2, token) {
|
|
5105
|
+
const res = await this.execute(sql2, token);
|
|
4930
5106
|
return Number(res[0]["count"]);
|
|
4931
5107
|
}
|
|
4932
5108
|
}
|
|
@@ -4959,7 +5135,7 @@ class PgTransaction extends PgDatabase {
|
|
|
4959
5135
|
}
|
|
4960
5136
|
}
|
|
4961
5137
|
|
|
4962
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
5138
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/postgres-js/session.js
|
|
4963
5139
|
class PostgresJsPreparedQuery extends PgPreparedQuery {
|
|
4964
5140
|
constructor(client, queryString, params, logger, fields, _isResponseInArrayMode, customResultMapper) {
|
|
4965
5141
|
super({ sql: queryString, params });
|
|
@@ -5067,7 +5243,7 @@ class PostgresJsTransaction extends PgTransaction {
|
|
|
5067
5243
|
}
|
|
5068
5244
|
}
|
|
5069
5245
|
|
|
5070
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
5246
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/postgres-js/driver.js
|
|
5071
5247
|
class PostgresJsDatabase extends PgDatabase {
|
|
5072
5248
|
static [entityKind] = "PostgresJsDatabase";
|
|
5073
5249
|
}
|
|
@@ -5126,7 +5302,7 @@ function drizzle(...params) {
|
|
|
5126
5302
|
drizzle2.mock = mock;
|
|
5127
5303
|
})(drizzle || (drizzle = {}));
|
|
5128
5304
|
|
|
5129
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.
|
|
5305
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/migrator.js
|
|
5130
5306
|
import crypto2 from "crypto";
|
|
5131
5307
|
import fs2 from "fs";
|
|
5132
5308
|
function readMigrationFiles(config) {
|
|
@@ -5158,13 +5334,13 @@ function readMigrationFiles(config) {
|
|
|
5158
5334
|
return migrationQueries;
|
|
5159
5335
|
}
|
|
5160
5336
|
|
|
5161
|
-
// /
|
|
5337
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.37.0_@types+react@19.0.1_bun-types@1.1.38_postgres@3.4.5_react@19.0.0/node_modules/drizzle-orm/postgres-js/migrator.js
|
|
5162
5338
|
async function migrate(db, config) {
|
|
5163
5339
|
const migrations = readMigrationFiles(config);
|
|
5164
5340
|
await db.dialect.migrate(migrations, db.session, config);
|
|
5165
5341
|
}
|
|
5166
5342
|
|
|
5167
|
-
// /
|
|
5343
|
+
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
5168
5344
|
var util;
|
|
5169
5345
|
(function(util2) {
|
|
5170
5346
|
util2.assertEqual = (val) => val;
|
|
@@ -5958,13 +6134,13 @@ var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]
|
|
|
5958
6134
|
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
5959
6135
|
var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
5960
6136
|
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
5961
|
-
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})
|
|
6137
|
+
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
5962
6138
|
var emojiRegex;
|
|
5963
6139
|
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
5964
6140
|
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
5965
6141
|
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
5966
6142
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
5967
|
-
var dateRegex = new RegExp(`^${dateRegexSource}
|
|
6143
|
+
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
5968
6144
|
function timeRegexSource(args) {
|
|
5969
6145
|
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
5970
6146
|
if (args.precision) {
|
|
@@ -5975,7 +6151,7 @@ function timeRegexSource(args) {
|
|
|
5975
6151
|
return regex;
|
|
5976
6152
|
}
|
|
5977
6153
|
function timeRegex(args) {
|
|
5978
|
-
return new RegExp(`^${timeRegexSource(args)}
|
|
6154
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
5979
6155
|
}
|
|
5980
6156
|
function datetimeRegex(args) {
|
|
5981
6157
|
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
@@ -5984,7 +6160,7 @@ function datetimeRegex(args) {
|
|
|
5984
6160
|
if (args.offset)
|
|
5985
6161
|
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
5986
6162
|
regex = `${regex}(${opts.join("|")})`;
|
|
5987
|
-
return new RegExp(`^${regex}
|
|
6163
|
+
return new RegExp(`^${regex}$`);
|
|
5988
6164
|
}
|
|
5989
6165
|
function isValidIP(ip, version2) {
|
|
5990
6166
|
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
|
@@ -9026,7 +9202,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
9026
9202
|
ZodError
|
|
9027
9203
|
});
|
|
9028
9204
|
|
|
9029
|
-
//
|
|
9205
|
+
// ../../node_modules/.pnpm/@t3-oss+env-core@0.11.1_typescript@5.7.2_zod@3.23.8/node_modules/@t3-oss/env-core/dist/index.js
|
|
9030
9206
|
function createEnv(opts) {
|
|
9031
9207
|
const runtimeEnv = opts.runtimeEnvStrict ?? opts.runtimeEnv ?? process.env;
|
|
9032
9208
|
const emptyStringAsUndefined = opts.emptyStringAsUndefined ?? false;
|