drizzle-orm 1.0.0-beta.1-f92627f → 1.0.0-beta.1-cdf226f
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/effect/effect-wrapper.cjs +46 -0
- package/effect/effect-wrapper.cjs.map +1 -0
- package/effect/effect-wrapper.d.cts +8 -0
- package/effect/effect-wrapper.d.ts +8 -0
- package/effect/effect-wrapper.js +22 -0
- package/effect/effect-wrapper.js.map +1 -0
- package/effect/sqlite/db.cjs +371 -0
- package/effect/sqlite/db.cjs.map +1 -0
- package/effect/sqlite/db.d.cts +277 -0
- package/effect/sqlite/db.d.ts +277 -0
- package/effect/sqlite/db.js +351 -0
- package/effect/sqlite/db.js.map +1 -0
- package/effect/sqlite/driver.cjs +67 -0
- package/effect/sqlite/driver.cjs.map +1 -0
- package/effect/sqlite/driver.d.cts +4 -0
- package/effect/sqlite/driver.d.ts +4 -0
- package/effect/sqlite/driver.js +33 -0
- package/effect/sqlite/driver.js.map +1 -0
- package/effect/sqlite/index.cjs +25 -0
- package/effect/sqlite/index.cjs.map +1 -0
- package/effect/sqlite/index.d.cts +2 -0
- package/effect/sqlite/index.d.ts +2 -0
- package/effect/sqlite/index.js +3 -0
- package/effect/sqlite/index.js.map +1 -0
- package/effect/sqlite/query-builders/select.cjs +122 -0
- package/effect/sqlite/query-builders/select.cjs.map +1 -0
- package/effect/sqlite/query-builders/select.d.cts +62 -0
- package/effect/sqlite/query-builders/select.d.ts +62 -0
- package/effect/sqlite/query-builders/select.js +97 -0
- package/effect/sqlite/query-builders/select.js.map +1 -0
- package/effect/sqlite/session.cjs +237 -0
- package/effect/sqlite/session.cjs.map +1 -0
- package/effect/sqlite/session.d.cts +79 -0
- package/effect/sqlite/session.d.ts +79 -0
- package/effect/sqlite/session.js +212 -0
- package/effect/sqlite/session.js.map +1 -0
- package/package.json +139 -52
- package/sqlite-core/session.cjs.map +1 -1
- package/sqlite-core/session.d.cts +1 -1
- package/sqlite-core/session.d.ts +1 -1
- package/sqlite-core/session.js.map +1 -1
- package/version.cjs +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var effect_wrapper_exports = {};
|
|
20
|
+
__export(effect_wrapper_exports, {
|
|
21
|
+
effectWrap: () => effectWrap
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(effect_wrapper_exports);
|
|
24
|
+
function effectWrap(target) {
|
|
25
|
+
const tryPromise = target.effect();
|
|
26
|
+
return new Proxy(target, {
|
|
27
|
+
get(target2, p) {
|
|
28
|
+
if (typeof p === "string" && ["then", "catch", "finally"].includes(p)) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
"Cannot use Effect query as promise. Use `yield* query` or `Effect.runPromise(query)` instead."
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (p in target2) return target2[p];
|
|
34
|
+
return tryPromise[p];
|
|
35
|
+
},
|
|
36
|
+
set(target2, p, newValue) {
|
|
37
|
+
if (p in target2) return target2[p] = newValue;
|
|
38
|
+
return tryPromise[p] = newValue;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
effectWrap
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=effect-wrapper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/effect/effect-wrapper.ts"],"sourcesContent":["import type { SqlClient } from '@effect/sql/SqlClient';\nimport type { SqlError } from '@effect/sql/SqlError';\nimport type { Effect } from 'effect';\n\ninterface EffectWrappable {\n\teffect: (placeholderValues?: Record<string, unknown>) => Effect.Effect<any, SqlError, SqlClient>;\n}\n\nexport function effectWrap<T extends EffectWrappable>(target: T): T {\n\tconst tryPromise = target.effect();\n\n\treturn new Proxy(target, {\n\t\tget(target, p) {\n\t\t\tif (typeof p === 'string' && ['then', 'catch', 'finally'].includes(p)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Cannot use Effect query as promise. Use `yield* query` or `Effect.runPromise(query)` instead.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (p in target) return target[p as keyof EffectWrappable];\n\n\t\t\treturn tryPromise[p as keyof typeof tryPromise];\n\t\t},\n\t\tset(target, p, newValue) {\n\t\t\tif (p in target) return (<any> target[p as keyof typeof target]) = newValue as any;\n\n\t\t\treturn (<any> tryPromise[p as keyof typeof tryPromise]) = newValue;\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,WAAsC,QAAc;AACnE,QAAM,aAAa,OAAO,OAAO;AAEjC,SAAO,IAAI,MAAM,QAAQ;AAAA,IACxB,IAAIA,SAAQ,GAAG;AACd,UAAI,OAAO,MAAM,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,SAAS,CAAC,GAAG;AACtE,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AACA,UAAI,KAAKA,QAAQ,QAAOA,QAAO,CAA0B;AAEzD,aAAO,WAAW,CAA4B;AAAA,IAC/C;AAAA,IACA,IAAIA,SAAQ,GAAG,UAAU;AACxB,UAAI,KAAKA,QAAQ,QAAcA,QAAO,CAAwB,IAAK;AAEnE,aAAc,WAAW,CAA4B,IAAK;AAAA,IAC3D;AAAA,EACD,CAAC;AACF;","names":["target"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SqlClient } from '@effect/sql/SqlClient';
|
|
2
|
+
import type { SqlError } from '@effect/sql/SqlError';
|
|
3
|
+
import type { Effect } from 'effect';
|
|
4
|
+
interface EffectWrappable {
|
|
5
|
+
effect: (placeholderValues?: Record<string, unknown>) => Effect.Effect<any, SqlError, SqlClient>;
|
|
6
|
+
}
|
|
7
|
+
export declare function effectWrap<T extends EffectWrappable>(target: T): T;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SqlClient } from '@effect/sql/SqlClient';
|
|
2
|
+
import type { SqlError } from '@effect/sql/SqlError';
|
|
3
|
+
import type { Effect } from 'effect';
|
|
4
|
+
interface EffectWrappable {
|
|
5
|
+
effect: (placeholderValues?: Record<string, unknown>) => Effect.Effect<any, SqlError, SqlClient>;
|
|
6
|
+
}
|
|
7
|
+
export declare function effectWrap<T extends EffectWrappable>(target: T): T;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function effectWrap(target) {
|
|
2
|
+
const tryPromise = target.effect();
|
|
3
|
+
return new Proxy(target, {
|
|
4
|
+
get(target2, p) {
|
|
5
|
+
if (typeof p === "string" && ["then", "catch", "finally"].includes(p)) {
|
|
6
|
+
throw new Error(
|
|
7
|
+
"Cannot use Effect query as promise. Use `yield* query` or `Effect.runPromise(query)` instead."
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
if (p in target2) return target2[p];
|
|
11
|
+
return tryPromise[p];
|
|
12
|
+
},
|
|
13
|
+
set(target2, p, newValue) {
|
|
14
|
+
if (p in target2) return target2[p] = newValue;
|
|
15
|
+
return tryPromise[p] = newValue;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
effectWrap
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=effect-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/effect/effect-wrapper.ts"],"sourcesContent":["import type { SqlClient } from '@effect/sql/SqlClient';\nimport type { SqlError } from '@effect/sql/SqlError';\nimport type { Effect } from 'effect';\n\ninterface EffectWrappable {\n\teffect: (placeholderValues?: Record<string, unknown>) => Effect.Effect<any, SqlError, SqlClient>;\n}\n\nexport function effectWrap<T extends EffectWrappable>(target: T): T {\n\tconst tryPromise = target.effect();\n\n\treturn new Proxy(target, {\n\t\tget(target, p) {\n\t\t\tif (typeof p === 'string' && ['then', 'catch', 'finally'].includes(p)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Cannot use Effect query as promise. Use `yield* query` or `Effect.runPromise(query)` instead.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (p in target) return target[p as keyof EffectWrappable];\n\n\t\t\treturn tryPromise[p as keyof typeof tryPromise];\n\t\t},\n\t\tset(target, p, newValue) {\n\t\t\tif (p in target) return (<any> target[p as keyof typeof target]) = newValue as any;\n\n\t\t\treturn (<any> tryPromise[p as keyof typeof tryPromise]) = newValue;\n\t\t},\n\t});\n}\n"],"mappings":"AAQO,SAAS,WAAsC,QAAc;AACnE,QAAM,aAAa,OAAO,OAAO;AAEjC,SAAO,IAAI,MAAM,QAAQ;AAAA,IACxB,IAAIA,SAAQ,GAAG;AACd,UAAI,OAAO,MAAM,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,SAAS,CAAC,GAAG;AACtE,cAAM,IAAI;AAAA,UACT;AAAA,QACD;AAAA,MACD;AACA,UAAI,KAAKA,QAAQ,QAAOA,QAAO,CAA0B;AAEzD,aAAO,WAAW,CAA4B;AAAA,IAC/C;AAAA,IACA,IAAIA,SAAQ,GAAG,UAAU;AACxB,UAAI,KAAKA,QAAQ,QAAcA,QAAO,CAAwB,IAAK;AAEnE,aAAc,WAAW,CAA4B,IAAK;AAAA,IAC3D;AAAA,EACD,CAAC;AACF;","names":["target"]}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var db_exports = {};
|
|
20
|
+
__export(db_exports, {
|
|
21
|
+
EffectSQLiteDatabase: () => EffectSQLiteDatabase,
|
|
22
|
+
withReplicas: () => withReplicas
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(db_exports);
|
|
25
|
+
var import_entity = require("../../entity.cjs");
|
|
26
|
+
var import_selection_proxy = require("../../selection-proxy.cjs");
|
|
27
|
+
var import_sql = require("../../sql/sql.cjs");
|
|
28
|
+
var import_query = require("../../sqlite-core/query-builders/_query.cjs");
|
|
29
|
+
var import_count = require("../../sqlite-core/query-builders/count.cjs");
|
|
30
|
+
var import_query_builders = require("../../sqlite-core/query-builders/index.cjs");
|
|
31
|
+
var import_query2 = require("../../sqlite-core/query-builders/query.cjs");
|
|
32
|
+
var import_subquery = require("../../subquery.cjs");
|
|
33
|
+
var import_select = require("./query-builders/select.cjs");
|
|
34
|
+
class EffectSQLiteDatabase {
|
|
35
|
+
constructor(dialect, session, relations, _schema, rowModeRQB, forbidJsonb) {
|
|
36
|
+
this.dialect = dialect;
|
|
37
|
+
this.session = session;
|
|
38
|
+
this.rowModeRQB = rowModeRQB;
|
|
39
|
+
this.forbidJsonb = forbidJsonb;
|
|
40
|
+
this._ = _schema ? {
|
|
41
|
+
schema: _schema.schema,
|
|
42
|
+
fullSchema: _schema.fullSchema,
|
|
43
|
+
tableNamesMap: _schema.tableNamesMap,
|
|
44
|
+
relations
|
|
45
|
+
} : {
|
|
46
|
+
schema: void 0,
|
|
47
|
+
fullSchema: {},
|
|
48
|
+
tableNamesMap: {},
|
|
49
|
+
relations
|
|
50
|
+
};
|
|
51
|
+
this._query = {};
|
|
52
|
+
const query = this._query;
|
|
53
|
+
if (this._.schema) {
|
|
54
|
+
for (const [tableName, columns] of Object.entries(this._.schema)) {
|
|
55
|
+
query[tableName] = new import_query._RelationalQueryBuilder(
|
|
56
|
+
"sync",
|
|
57
|
+
_schema.fullSchema,
|
|
58
|
+
this._.schema,
|
|
59
|
+
this._.tableNamesMap,
|
|
60
|
+
_schema.fullSchema[tableName],
|
|
61
|
+
columns,
|
|
62
|
+
dialect,
|
|
63
|
+
session
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
this.query = {};
|
|
68
|
+
for (const [tableName, relation] of Object.entries(relations)) {
|
|
69
|
+
this.query[tableName] = new import_query2.RelationalQueryBuilder(
|
|
70
|
+
"sync",
|
|
71
|
+
relations,
|
|
72
|
+
relations[relation.name].table,
|
|
73
|
+
relation,
|
|
74
|
+
dialect,
|
|
75
|
+
session,
|
|
76
|
+
rowModeRQB,
|
|
77
|
+
forbidJsonb
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
this.$cache = { invalidate: async (_params) => {
|
|
81
|
+
} };
|
|
82
|
+
}
|
|
83
|
+
static [import_entity.entityKind] = "EffectSQLiteDatabase";
|
|
84
|
+
/** @deprecated */
|
|
85
|
+
_query;
|
|
86
|
+
// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas
|
|
87
|
+
query;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a subquery that defines a temporary named result set as a CTE.
|
|
90
|
+
*
|
|
91
|
+
* It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.
|
|
92
|
+
*
|
|
93
|
+
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
|
|
94
|
+
*
|
|
95
|
+
* @param alias The alias for the subquery.
|
|
96
|
+
*
|
|
97
|
+
* Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* // Create a subquery with alias 'sq' and use it in the select query
|
|
103
|
+
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
|
|
104
|
+
*
|
|
105
|
+
* const result = yield* db.with(sq).select().from(sq);
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* // Select an arbitrary SQL value as a field in a CTE and reference it in the main query
|
|
112
|
+
* const sq = db.$with('sq').as(db.select({
|
|
113
|
+
* name: sql<string>`upper(${users.name})`.as('name'),
|
|
114
|
+
* })
|
|
115
|
+
* .from(users));
|
|
116
|
+
*
|
|
117
|
+
* const result = yield* db.with(sq).select({ name: sq.name }).from(sq);
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
$with = (alias, selection) => {
|
|
121
|
+
const self = this;
|
|
122
|
+
const as = (qb) => {
|
|
123
|
+
if (typeof qb === "function") {
|
|
124
|
+
qb = qb(new import_query_builders.QueryBuilder(self.dialect));
|
|
125
|
+
}
|
|
126
|
+
return new Proxy(
|
|
127
|
+
new import_subquery.WithSubquery(
|
|
128
|
+
qb.getSQL(),
|
|
129
|
+
selection ?? ("getSelectedFields" in qb ? qb.getSelectedFields() ?? {} : {}),
|
|
130
|
+
alias,
|
|
131
|
+
true
|
|
132
|
+
),
|
|
133
|
+
new import_selection_proxy.SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" })
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
return { as };
|
|
137
|
+
};
|
|
138
|
+
$count(source, filters) {
|
|
139
|
+
return new import_count.SQLiteCountBuilder({ source, filters, session: this.session });
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Incorporates a previously defined CTE (using `$with`) into the main query.
|
|
143
|
+
*
|
|
144
|
+
* This method allows the main query to reference a temporary named result set.
|
|
145
|
+
*
|
|
146
|
+
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
|
|
147
|
+
*
|
|
148
|
+
* @param queries The CTEs to incorporate into the main query.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
*
|
|
152
|
+
* ```ts
|
|
153
|
+
* // Define a subquery 'sq' as a CTE using $with
|
|
154
|
+
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
|
|
155
|
+
*
|
|
156
|
+
* // Incorporate the CTE 'sq' into the main query and select from it
|
|
157
|
+
* const result = yield* db.with(sq).select().from(sq);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
with(...queries) {
|
|
161
|
+
const self = this;
|
|
162
|
+
function select(fields) {
|
|
163
|
+
return new import_select.EffectSQLiteSelectBuilder({
|
|
164
|
+
fields: fields ?? void 0,
|
|
165
|
+
session: self.session,
|
|
166
|
+
dialect: self.dialect,
|
|
167
|
+
withList: queries
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function selectDistinct(fields) {
|
|
171
|
+
return new import_select.EffectSQLiteSelectBuilder({
|
|
172
|
+
fields: fields ?? void 0,
|
|
173
|
+
session: self.session,
|
|
174
|
+
dialect: self.dialect,
|
|
175
|
+
withList: queries,
|
|
176
|
+
distinct: true
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function update(table) {
|
|
180
|
+
return new import_query_builders.SQLiteUpdateBuilder(table, self.session, self.dialect, queries);
|
|
181
|
+
}
|
|
182
|
+
function insert(into) {
|
|
183
|
+
return new import_query_builders.SQLiteInsertBuilder(into, self.session, self.dialect, queries);
|
|
184
|
+
}
|
|
185
|
+
function delete_(from) {
|
|
186
|
+
return new import_query_builders.SQLiteDeleteBase(from, self.session, self.dialect, queries);
|
|
187
|
+
}
|
|
188
|
+
return { select, selectDistinct, update, insert, delete: delete_ };
|
|
189
|
+
}
|
|
190
|
+
select(fields) {
|
|
191
|
+
return new import_select.EffectSQLiteSelectBuilder({ fields: fields ?? void 0, session: this.session, dialect: this.dialect });
|
|
192
|
+
}
|
|
193
|
+
selectDistinct(fields) {
|
|
194
|
+
return new import_select.EffectSQLiteSelectBuilder({
|
|
195
|
+
fields: fields ?? void 0,
|
|
196
|
+
session: this.session,
|
|
197
|
+
dialect: this.dialect,
|
|
198
|
+
distinct: true
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Creates an update query.
|
|
203
|
+
*
|
|
204
|
+
* Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.
|
|
205
|
+
*
|
|
206
|
+
* Use `.set()` method to specify which values to update.
|
|
207
|
+
*
|
|
208
|
+
* See docs: {@link https://orm.drizzle.team/docs/update}
|
|
209
|
+
*
|
|
210
|
+
* @param table The table to update.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
*
|
|
214
|
+
* ```ts
|
|
215
|
+
* // Update all rows in the 'cars' table
|
|
216
|
+
* yield* db.update(cars).set({ color: 'red' });
|
|
217
|
+
*
|
|
218
|
+
* // Update rows with filters and conditions
|
|
219
|
+
* yield* db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));
|
|
220
|
+
*
|
|
221
|
+
* // Update with returning clause
|
|
222
|
+
* const updatedCar: Car[] = yield* db.update(cars)
|
|
223
|
+
* .set({ color: 'red' })
|
|
224
|
+
* .where(eq(cars.id, 1))
|
|
225
|
+
* .returning();
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
update(table) {
|
|
229
|
+
return new import_query_builders.SQLiteUpdateBuilder(table, this.session, this.dialect);
|
|
230
|
+
}
|
|
231
|
+
$cache;
|
|
232
|
+
/**
|
|
233
|
+
* Creates an insert query.
|
|
234
|
+
*
|
|
235
|
+
* Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.
|
|
236
|
+
*
|
|
237
|
+
* See docs: {@link https://orm.drizzle.team/docs/insert}
|
|
238
|
+
*
|
|
239
|
+
* @param table The table to insert into.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
*
|
|
243
|
+
* ```ts
|
|
244
|
+
* // Insert one row
|
|
245
|
+
* yield* db.insert(cars).values({ brand: 'BMW' });
|
|
246
|
+
*
|
|
247
|
+
* // Insert multiple rows
|
|
248
|
+
* yield* db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);
|
|
249
|
+
*
|
|
250
|
+
* // Insert with returning clause
|
|
251
|
+
* const insertedCar: Car[] = yield* db.insert(cars)
|
|
252
|
+
* .values({ brand: 'BMW' })
|
|
253
|
+
* .returning();
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
insert(into) {
|
|
257
|
+
return new import_query_builders.SQLiteInsertBuilder(into, this.session, this.dialect);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Creates a delete query.
|
|
261
|
+
*
|
|
262
|
+
* Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.
|
|
263
|
+
*
|
|
264
|
+
* See docs: {@link https://orm.drizzle.team/docs/delete}
|
|
265
|
+
*
|
|
266
|
+
* @param table The table to delete from.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
*
|
|
270
|
+
* ```ts
|
|
271
|
+
* // Delete all rows in the 'cars' table
|
|
272
|
+
* yield* db.delete(cars);
|
|
273
|
+
*
|
|
274
|
+
* // Delete rows with filters and conditions
|
|
275
|
+
* yield* db.delete(cars).where(eq(cars.color, 'green'));
|
|
276
|
+
*
|
|
277
|
+
* // Delete with returning clause
|
|
278
|
+
* const deletedCar: Car[] = yield* db.delete(cars)
|
|
279
|
+
* .where(eq(cars.id, 1))
|
|
280
|
+
* .returning();
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
delete(from) {
|
|
284
|
+
return new import_query_builders.SQLiteDeleteBase(from, this.session, this.dialect);
|
|
285
|
+
}
|
|
286
|
+
/** @deprecated Use `.effectRun()` for `Effect` compatibility */
|
|
287
|
+
run = () => {
|
|
288
|
+
throw new Error("Use `.effectRun()` for `Effect` compatibility");
|
|
289
|
+
};
|
|
290
|
+
/** @deprecated Use `.effectAll()` for `Effect` compatibility */
|
|
291
|
+
all = () => {
|
|
292
|
+
throw new Error("Use `.effectAll()` for `Effect` compatibility");
|
|
293
|
+
};
|
|
294
|
+
/** @deprecated Use `.effectGet()` for `Effect` compatibility */
|
|
295
|
+
get = () => {
|
|
296
|
+
throw new Error("Use `.effectGet()` for `Effect` compatibility");
|
|
297
|
+
};
|
|
298
|
+
/** @deprecated Use `.effectValues()` for `Effect` compatibility */
|
|
299
|
+
values = () => {
|
|
300
|
+
throw new Error("Use `.effectValues()` for `Effect` compatibility");
|
|
301
|
+
};
|
|
302
|
+
effectRun(query) {
|
|
303
|
+
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
|
|
304
|
+
return this.session.effectRun(sequel);
|
|
305
|
+
}
|
|
306
|
+
effectAll(query) {
|
|
307
|
+
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
|
|
308
|
+
return this.session.effectAll(sequel);
|
|
309
|
+
}
|
|
310
|
+
effectGet(query) {
|
|
311
|
+
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
|
|
312
|
+
return this.session.effectGet(sequel);
|
|
313
|
+
}
|
|
314
|
+
effectValues(query) {
|
|
315
|
+
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
|
|
316
|
+
return this.session.effectValues(sequel);
|
|
317
|
+
}
|
|
318
|
+
transaction(transaction, config) {
|
|
319
|
+
return this.session.transaction(transaction, config);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const withReplicas = (primary, replicas, getReplica = () => replicas[Math.floor(Math.random() * replicas.length)]) => {
|
|
323
|
+
const select = (...args) => getReplica(replicas).select(...args);
|
|
324
|
+
const selectDistinct = (...args) => getReplica(replicas).selectDistinct(...args);
|
|
325
|
+
const $count = (...args) => getReplica(replicas).$count(...args);
|
|
326
|
+
const $with = (...args) => getReplica(replicas).with(...args);
|
|
327
|
+
const update = (...args) => primary.update(...args);
|
|
328
|
+
const insert = (...args) => primary.insert(...args);
|
|
329
|
+
const $delete = (...args) => primary.delete(...args);
|
|
330
|
+
const run = (...args) => primary.run(...args);
|
|
331
|
+
const all = (...args) => primary.all(...args);
|
|
332
|
+
const get = (...args) => primary.get(...args);
|
|
333
|
+
const values = (...args) => primary.values(...args);
|
|
334
|
+
const effectRun = (...args) => primary.effectRun(...args);
|
|
335
|
+
const effectAll = (...args) => primary.effectAll(...args);
|
|
336
|
+
const effectGet = (...args) => primary.effectGet(...args);
|
|
337
|
+
const effectValues = (...args) => primary.effectValues(...args);
|
|
338
|
+
const transaction = (...args) => primary.transaction(...args);
|
|
339
|
+
return {
|
|
340
|
+
...primary,
|
|
341
|
+
update,
|
|
342
|
+
insert,
|
|
343
|
+
delete: $delete,
|
|
344
|
+
run,
|
|
345
|
+
all,
|
|
346
|
+
get,
|
|
347
|
+
values,
|
|
348
|
+
effectRun,
|
|
349
|
+
effectAll,
|
|
350
|
+
effectGet,
|
|
351
|
+
effectValues,
|
|
352
|
+
transaction,
|
|
353
|
+
$primary: primary,
|
|
354
|
+
select,
|
|
355
|
+
selectDistinct,
|
|
356
|
+
$count,
|
|
357
|
+
with: $with,
|
|
358
|
+
get _query() {
|
|
359
|
+
return getReplica(replicas)._query;
|
|
360
|
+
},
|
|
361
|
+
get query() {
|
|
362
|
+
return getReplica(replicas).query;
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
367
|
+
0 && (module.exports = {
|
|
368
|
+
EffectSQLiteDatabase,
|
|
369
|
+
withReplicas
|
|
370
|
+
});
|
|
371
|
+
//# sourceMappingURL=db.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/effect/sqlite/db.ts"],"sourcesContent":["import type { SqliteClient } from '@effect/sql-sqlite-node/SqliteClient';\nimport type { SqlError } from '@effect/sql/SqlError';\nimport type { Effect } from 'effect/Effect';\nimport type * as V1 from '~/_relations.ts';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AnyRelations, EmptyRelations } from '~/relations.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { type ColumnsSelection, type SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect.ts';\nimport { _RelationalQueryBuilder } from '~/sqlite-core/query-builders/_query.ts';\nimport { SQLiteCountBuilder } from '~/sqlite-core/query-builders/count.ts';\nimport {\n\tQueryBuilder,\n\tSQLiteDeleteBase,\n\tSQLiteInsertBuilder,\n\tSQLiteUpdateBuilder,\n} from '~/sqlite-core/query-builders/index.ts';\nimport { RelationalQueryBuilder } from '~/sqlite-core/query-builders/query.ts';\nimport type { SelectedFields } from '~/sqlite-core/query-builders/select.types.ts';\nimport type { Result, SQLiteTransaction, SQLiteTransactionConfig } from '~/sqlite-core/session.ts';\nimport type { WithBuilder } from '~/sqlite-core/subquery.ts';\nimport type { SQLiteTable } from '~/sqlite-core/table.ts';\nimport type { SQLiteViewBase } from '~/sqlite-core/view-base.ts';\nimport { WithSubquery } from '~/subquery.ts';\nimport type { DrizzleTypeError } from '~/utils.ts';\nimport { EffectSQLiteSelectBuilder } from './query-builders/select.ts';\nimport type { EffectSQLiteSession } from './session.ts';\n\nexport class EffectSQLiteDatabase<\n\tTFullSchema extends Record<string, unknown> = Record<string, never>,\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>,\n> {\n\tstatic readonly [entityKind]: string = 'EffectSQLiteDatabase';\n\n\tdeclare readonly _: {\n\t\treadonly schema: TSchema | undefined;\n\t\treadonly fullSchema: TFullSchema;\n\t\treadonly tableNamesMap: Record<string, string>;\n\t\treadonly relations: TRelations;\n\t};\n\n\t/** @deprecated */\n\t_query: TFullSchema extends Record<string, never>\n\t\t? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'>\n\t\t: {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<'sync', TFullSchema, TSchema, TSchema[K]>;\n\t\t};\n\n\t// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas\n\tquery: {\n\t\t[K in keyof TRelations]: RelationalQueryBuilder<\n\t\t\t'sync',\n\t\t\tTRelations,\n\t\t\tTRelations[K]\n\t\t>;\n\t};\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }['sync'],\n\t\t/** @internal */\n\t\treadonly session: EffectSQLiteSession<TFullSchema, TRelations, TSchema>,\n\t\trelations: TRelations,\n\t\t_schema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t\treadonly rowModeRQB?: boolean,\n\t\treadonly forbidJsonb?: boolean,\n\t) {\n\t\tthis._ = _schema\n\t\t\t? {\n\t\t\t\tschema: _schema.schema,\n\t\t\t\tfullSchema: _schema.fullSchema as TFullSchema,\n\t\t\t\ttableNamesMap: _schema.tableNamesMap,\n\t\t\t\trelations,\n\t\t\t}\n\t\t\t: {\n\t\t\t\tschema: undefined,\n\t\t\t\tfullSchema: {} as TFullSchema,\n\t\t\t\ttableNamesMap: {},\n\t\t\t\trelations,\n\t\t\t};\n\n\t\tthis._query = {} as typeof this['_query'];\n\t\tconst query = this._query as {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<'sync', TFullSchema, TSchema, TSchema[K]>;\n\t\t};\n\t\tif (this._.schema) {\n\t\t\tfor (const [tableName, columns] of Object.entries(this._.schema)) {\n\t\t\t\tquery[tableName as keyof TSchema] = new _RelationalQueryBuilder(\n\t\t\t\t\t'sync',\n\t\t\t\t\t_schema!.fullSchema,\n\t\t\t\t\tthis._.schema,\n\t\t\t\t\tthis._.tableNamesMap,\n\t\t\t\t\t_schema!.fullSchema[tableName] as SQLiteTable,\n\t\t\t\t\tcolumns,\n\t\t\t\t\tdialect,\n\t\t\t\t\tsession as any,\n\t\t\t\t) as typeof query[keyof TSchema];\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tfor (const [tableName, relation] of Object.entries(relations)) {\n\t\t\t(this.query as EffectSQLiteDatabase<\n\t\t\t\tTSchema,\n\t\t\t\tAnyRelations,\n\t\t\t\tV1.TablesRelationalConfig\n\t\t\t>['query'])[tableName] = new RelationalQueryBuilder(\n\t\t\t\t'sync',\n\t\t\t\trelations,\n\t\t\t\trelations[relation.name]!.table as SQLiteTable,\n\t\t\t\trelation,\n\t\t\t\tdialect,\n\t\t\t\tsession as EffectSQLiteSession<any, any, any>,\n\t\t\t\trowModeRQB,\n\t\t\t\tforbidJsonb,\n\t\t\t);\n\t\t}\n\t\tthis.$cache = { invalidate: async (_params: any) => {} };\n\t}\n\n\t/**\n\t * Creates a subquery that defines a temporary named result set as a CTE.\n\t *\n\t * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param alias The alias for the subquery.\n\t *\n\t * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Create a subquery with alias 'sq' and use it in the select query\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * const result = yield* db.with(sq).select().from(sq);\n\t * ```\n\t *\n\t * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:\n\t *\n\t * ```ts\n\t * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query\n\t * const sq = db.$with('sq').as(db.select({\n\t * name: sql<string>`upper(${users.name})`.as('name'),\n\t * })\n\t * .from(users));\n\t *\n\t * const result = yield* db.with(sq).select({ name: sq.name }).from(sq);\n\t * ```\n\t */\n\t$with: WithBuilder = (alias: string, selection?: ColumnsSelection) => {\n\t\tconst self = this;\n\t\tconst as = (\n\t\t\tqb:\n\t\t\t\t| TypedQueryBuilder<ColumnsSelection | undefined>\n\t\t\t\t| SQL\n\t\t\t\t| ((qb: QueryBuilder) => TypedQueryBuilder<ColumnsSelection | undefined> | SQL),\n\t\t) => {\n\t\t\tif (typeof qb === 'function') {\n\t\t\t\tqb = qb(new QueryBuilder(self.dialect));\n\t\t\t}\n\n\t\t\treturn new Proxy(\n\t\t\t\tnew WithSubquery(\n\t\t\t\t\tqb.getSQL(),\n\t\t\t\t\tselection ?? ('getSelectedFields' in qb ? qb.getSelectedFields() ?? {} : {}) as SelectedFields,\n\t\t\t\t\talias,\n\t\t\t\t\ttrue,\n\t\t\t\t),\n\t\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t\t);\n\t\t};\n\t\treturn { as };\n\t};\n\n\t$count(\n\t\tsource: SQLiteTable | SQLiteViewBase | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t) {\n\t\treturn new SQLiteCountBuilder({ source, filters, session: this.session });\n\t}\n\n\t/**\n\t * Incorporates a previously defined CTE (using `$with`) into the main query.\n\t *\n\t * This method allows the main query to reference a temporary named result set.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param queries The CTEs to incorporate into the main query.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Define a subquery 'sq' as a CTE using $with\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * // Incorporate the CTE 'sq' into the main query and select from it\n\t * const result = yield* db.with(sq).select().from(sq);\n\t * ```\n\t */\n\twith(...queries: WithSubquery[]) {\n\t\tconst self = this;\n\n\t\t/**\n\t\t * Creates a select query.\n\t\t *\n\t\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all columns and all rows from the 'cars' table\n\t\t * const allCars: Car[] = yield* db.select().from(cars);\n\t\t *\n\t\t * // Select specific columns and all rows from the 'cars' table\n\t\t * const carsIdsAndBrands: { id: number; brand: string }[] = yield* db.select({\n\t\t * id: cars.id,\n\t\t * brand: cars.brand\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t *\n\t\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t\t *\n\t\t * ```ts\n\t\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = yield* db.select({\n\t\t * id: cars.id,\n\t\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t */\n\t\tfunction select(): EffectSQLiteSelectBuilder<undefined>;\n\t\tfunction select<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): EffectSQLiteSelectBuilder<TSelection>;\n\t\tfunction select(\n\t\t\tfields?: SelectedFields,\n\t\t): EffectSQLiteSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new EffectSQLiteSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct` expression to the select query.\n\t\t *\n\t\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all unique rows from the 'cars' table\n\t\t * yield* db.selectDistinct()\n\t\t * .from(cars)\n\t\t * .orderBy(cars.id, cars.brand, cars.color);\n\t\t *\n\t\t * // Select all unique brands from the 'cars' table\n\t\t * yield* db.selectDistinct({ brand: cars.brand })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinct(): EffectSQLiteSelectBuilder<undefined>;\n\t\tfunction selectDistinct<TSelection extends SelectedFields>(\n\t\t\tfields: TSelection,\n\t\t): EffectSQLiteSelectBuilder<TSelection>;\n\t\tfunction selectDistinct(\n\t\t\tfields?: SelectedFields,\n\t\t): EffectSQLiteSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new EffectSQLiteSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: true,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Creates an update query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t\t *\n\t\t * Use `.set()` method to specify which values to update.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t\t *\n\t\t * @param table The table to update.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Update all rows in the 'cars' table\n\t\t * yield* db.update(cars).set({ color: 'red' });\n\t\t *\n\t\t * // Update rows with filters and conditions\n\t\t * yield* db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t\t *\n\t\t * // Update with returning clause\n\t\t * const updatedCar: Car[] = yield* db.update(cars)\n\t\t * .set({ color: 'red' })\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction update<TTable extends SQLiteTable>(table: TTable): SQLiteUpdateBuilder<TTable, 'sync', unknown> {\n\t\t\treturn new SQLiteUpdateBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates an insert query.\n\t\t *\n\t\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t\t *\n\t\t * @param table The table to insert into.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Insert one row\n\t\t * yield* db.insert(cars).values({ brand: 'BMW' });\n\t\t *\n\t\t * // Insert multiple rows\n\t\t * yield* db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t\t *\n\t\t * // Insert with returning clause\n\t\t * const insertedCar: Car[] = yield* db.insert(cars)\n\t\t * .values({ brand: 'BMW' })\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction insert<TTable extends SQLiteTable>(into: TTable): SQLiteInsertBuilder<TTable, 'sync', unknown> {\n\t\t\treturn new SQLiteInsertBuilder(into, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates a delete query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t\t *\n\t\t * @param table The table to delete from.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Delete all rows in the 'cars' table\n\t\t * yield* db.delete(cars);\n\t\t *\n\t\t * // Delete rows with filters and conditions\n\t\t * yield* db.delete(cars).where(eq(cars.color, 'green'));\n\t\t *\n\t\t * // Delete with returning clause\n\t\t * const deletedCar: Car[] = yield* db.delete(cars)\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction delete_<TTable extends SQLiteTable>(from: TTable): SQLiteDeleteBase<TTable, 'sync', unknown> {\n\t\t\treturn new SQLiteDeleteBase(from, self.session, self.dialect, queries);\n\t\t}\n\n\t\treturn { select, selectDistinct, update, insert, delete: delete_ };\n\t}\n\n\t/**\n\t * Creates a select query.\n\t *\n\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all columns and all rows from the 'cars' table\n\t * const allCars: Car[] = yield* db.select().from(cars);\n\t *\n\t * // Select specific columns and all rows from the 'cars' table\n\t * const carsIdsAndBrands: { id: number; brand: string }[] = yield* db.select({\n\t * id: cars.id,\n\t * brand: cars.brand\n\t * })\n\t * .from(cars);\n\t * ```\n\t *\n\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t *\n\t * ```ts\n\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = yield* db.select({\n\t * id: cars.id,\n\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t * })\n\t * .from(cars);\n\t * ```\n\t */\n\tselect(): EffectSQLiteSelectBuilder<undefined>;\n\tselect<TSelection extends SelectedFields>(\n\t\tfields: TSelection,\n\t): EffectSQLiteSelectBuilder<TSelection>;\n\tselect(fields?: SelectedFields): EffectSQLiteSelectBuilder<SelectedFields | undefined> {\n\t\treturn new EffectSQLiteSelectBuilder({ fields: fields ?? undefined, session: this.session, dialect: this.dialect });\n\t}\n\n\t/**\n\t * Adds `distinct` expression to the select query.\n\t *\n\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all unique rows from the 'cars' table\n\t * yield* db.selectDistinct()\n\t * .from(cars)\n\t * .orderBy(cars.id, cars.brand, cars.color);\n\t *\n\t * // Select all unique brands from the 'cars' table\n\t * yield* db.selectDistinct({ brand: cars.brand })\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t * ```\n\t */\n\tselectDistinct(): EffectSQLiteSelectBuilder<undefined>;\n\tselectDistinct<TSelection extends SelectedFields>(\n\t\tfields: TSelection,\n\t): EffectSQLiteSelectBuilder<TSelection>;\n\tselectDistinct(\n\t\tfields?: SelectedFields,\n\t): EffectSQLiteSelectBuilder<SelectedFields | undefined> {\n\t\treturn new EffectSQLiteSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: true,\n\t\t});\n\t}\n\n\t/**\n\t * Creates an update query.\n\t *\n\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t *\n\t * Use `.set()` method to specify which values to update.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param table The table to update.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Update all rows in the 'cars' table\n\t * yield* db.update(cars).set({ color: 'red' });\n\t *\n\t * // Update rows with filters and conditions\n\t * yield* db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t *\n\t * // Update with returning clause\n\t * const updatedCar: Car[] = yield* db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tupdate<TTable extends SQLiteTable>(table: TTable): SQLiteUpdateBuilder<TTable, 'sync', unknown> {\n\t\treturn new SQLiteUpdateBuilder(table, this.session, this.dialect);\n\t}\n\n\t$cache: { invalidate: Cache['onMutate'] };\n\n\t/**\n\t * Creates an insert query.\n\t *\n\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t *\n\t * @param table The table to insert into.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Insert one row\n\t * yield* db.insert(cars).values({ brand: 'BMW' });\n\t *\n\t * // Insert multiple rows\n\t * yield* db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t *\n\t * // Insert with returning clause\n\t * const insertedCar: Car[] = yield* db.insert(cars)\n\t * .values({ brand: 'BMW' })\n\t * .returning();\n\t * ```\n\t */\n\tinsert<TTable extends SQLiteTable>(into: TTable): SQLiteInsertBuilder<TTable, 'sync', unknown> {\n\t\treturn new SQLiteInsertBuilder(into, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates a delete query.\n\t *\n\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t *\n\t * @param table The table to delete from.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Delete all rows in the 'cars' table\n\t * yield* db.delete(cars);\n\t *\n\t * // Delete rows with filters and conditions\n\t * yield* db.delete(cars).where(eq(cars.color, 'green'));\n\t *\n\t * // Delete with returning clause\n\t * const deletedCar: Car[] = yield* db.delete(cars)\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tdelete<TTable extends SQLiteTable>(from: TTable): SQLiteDeleteBase<TTable, 'sync', unknown> {\n\t\treturn new SQLiteDeleteBase(from, this.session, this.dialect);\n\t}\n\n\t/** @deprecated Use `.effectRun()` for `Effect` compatibility */\n\trun: any = () => {\n\t\tthrow new Error('Use `.effectRun()` for `Effect` compatibility');\n\t};\n\n\t/** @deprecated Use `.effectAll()` for `Effect` compatibility */\n\tall: any = () => {\n\t\tthrow new Error('Use `.effectAll()` for `Effect` compatibility');\n\t};\n\n\t/** @deprecated Use `.effectGet()` for `Effect` compatibility */\n\tget: any = () => {\n\t\tthrow new Error('Use `.effectGet()` for `Effect` compatibility');\n\t};\n\n\t/** @deprecated Use `.effectValues()` for `Effect` compatibility */\n\tvalues: any = () => {\n\t\tthrow new Error('Use `.effectValues()` for `Effect` compatibility');\n\t};\n\n\teffectRun(query: SQLWrapper | string): Effect<unknown, SqlError, SqliteClient> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\treturn this.session.effectRun(sequel) as Effect<unknown, SqlError, SqliteClient>;\n\t}\n\n\teffectAll<T = unknown>(query: SQLWrapper | string): Effect<T[], SqlError, SqliteClient> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\treturn this.session.effectAll(sequel) as Effect<T[], SqlError, SqliteClient>;\n\t}\n\n\teffectGet<T = unknown>(query: SQLWrapper | string): Effect<T, SqlError, SqliteClient> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\treturn this.session.effectGet(sequel) as Effect<T, SqlError, SqliteClient>;\n\t}\n\n\teffectValues<T extends unknown[] = unknown[]>(query: SQLWrapper | string): Effect<T[], SqlError, SqliteClient> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\treturn this.session.effectValues(sequel) as Effect<T[], SqlError, SqliteClient>;\n\t}\n\n\ttransaction<T>(\n\t\ttransaction: (\n\t\t\ttx: SQLiteTransaction<'sync', unknown, TFullSchema, TRelations, TSchema>,\n\t\t) => Result<'sync', T>,\n\t\tconfig?: SQLiteTransactionConfig,\n\t): Result<'sync', T> {\n\t\treturn this.session.transaction(transaction, config);\n\t}\n}\n\nexport type SQLiteWithReplicas<Q> = Q & { $primary: Q };\n\nexport const withReplicas = <\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTSchema extends V1.TablesRelationalConfig,\n\tQ extends EffectSQLiteDatabase<\n\t\tTFullSchema,\n\t\tTRelations,\n\t\tTSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema\n\t>,\n>(\n\tprimary: Q,\n\treplicas: [Q, ...Q[]],\n\tgetReplica: (replicas: Q[]) => Q = () => replicas[Math.floor(Math.random() * replicas.length)]!,\n): SQLiteWithReplicas<Q> => {\n\tconst select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);\n\tconst selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);\n\tconst $count: Q['$count'] = (...args: [any]) => getReplica(replicas).$count(...args);\n\tconst $with: Q['with'] = (...args: []) => getReplica(replicas).with(...args);\n\n\tconst update: Q['update'] = (...args: [any]) => primary.update(...args);\n\tconst insert: Q['insert'] = (...args: [any]) => primary.insert(...args);\n\tconst $delete: Q['delete'] = (...args: [any]) => primary.delete(...args);\n\tconst run: Q['run'] = (...args: [any]) => primary.run(...args);\n\tconst all: Q['all'] = (...args: [any]) => primary.all(...args);\n\tconst get: Q['get'] = (...args: [any]) => primary.get(...args);\n\tconst values: Q['values'] = (...args: [any]) => primary.values(...args);\n\tconst effectRun: Q['effectRun'] = (...args: [any]) => primary.effectRun(...args);\n\tconst effectAll: Q['effectAll'] = (...args: [any]) => primary.effectAll(...args);\n\tconst effectGet: Q['effectGet'] = (...args: [any]) => primary.effectGet(...args);\n\tconst effectValues: Q['effectValues'] = (...args: [any]) => primary.effectValues(...args);\n\tconst transaction: Q['transaction'] = (...args: [any]) => primary.transaction(...args);\n\n\treturn {\n\t\t...primary,\n\t\tupdate,\n\t\tinsert,\n\t\tdelete: $delete,\n\t\trun,\n\t\tall,\n\t\tget,\n\t\tvalues,\n\t\teffectRun,\n\t\teffectAll,\n\t\teffectGet,\n\t\teffectValues,\n\t\ttransaction,\n\t\t$primary: primary,\n\t\tselect,\n\t\tselectDistinct,\n\t\t$count,\n\t\twith: $with,\n\t\tget _query() {\n\t\t\treturn getReplica(replicas)._query;\n\t\t},\n\t\tget query() {\n\t\t\treturn getReplica(replicas).query;\n\t\t},\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAA2B;AAG3B,6BAAsC;AACtC,iBAAsE;AAEtE,mBAAwC;AACxC,mBAAmC;AACnC,4BAKO;AACP,IAAAA,gBAAuC;AAMvC,sBAA6B;AAE7B,oBAA0C;AAGnC,MAAM,qBAIX;AAAA,EA0BD,YAEU,SAEA,SACT,WACA,SACS,YACA,aACR;AAPQ;AAEA;AAGA;AACA;AAET,SAAK,IAAI,UACN;AAAA,MACD,QAAQ,QAAQ;AAAA,MAChB,YAAY,QAAQ;AAAA,MACpB,eAAe,QAAQ;AAAA,MACvB;AAAA,IACD,IACE;AAAA,MACD,QAAQ;AAAA,MACR,YAAY,CAAC;AAAA,MACb,eAAe,CAAC;AAAA,MAChB;AAAA,IACD;AAED,SAAK,SAAS,CAAC;AACf,UAAM,QAAQ,KAAK;AAGnB,QAAI,KAAK,EAAE,QAAQ;AAClB,iBAAW,CAAC,WAAW,OAA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