drizzle-orm 0.27.3-e080bed → 0.28.0-5dd9190
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/{alias-5aeeb2f5.cjs → alias-3f5ac719.cjs} +267 -142
- package/alias-3f5ac719.cjs.map +1 -0
- package/{alias-6eaa2e87.mjs → alias-7164ff43.mjs} +223 -126
- package/alias-7164ff43.mjs.map +1 -0
- package/aws-data-api/pg/index.cjs +1 -1
- package/aws-data-api/pg/index.d.ts +4 -4
- package/aws-data-api/pg/index.mjs +2 -2
- package/aws-data-api/pg/migrator.d.ts +4 -4
- package/better-sqlite3/index.cjs +2 -2
- package/better-sqlite3/index.d.ts +5 -5
- package/better-sqlite3/index.mjs +2 -2
- package/better-sqlite3/migrator.d.ts +5 -5
- package/bun-sqlite/index.cjs +2 -2
- package/bun-sqlite/index.d.ts +5 -5
- package/bun-sqlite/index.mjs +2 -2
- package/bun-sqlite/migrator.d.ts +5 -5
- package/column.d-9d2f4045.d.ts +1151 -0
- package/d1/index.cjs +2 -2
- package/d1/index.d.ts +5 -5
- package/d1/index.mjs +2 -2
- package/d1/migrator.d.ts +5 -5
- package/{driver.d-58d095ec.d.ts → driver.d-055d4782.d.ts} +2 -2
- package/{driver.d-d2f034d7.d.ts → driver.d-20707624.d.ts} +2 -2
- package/{driver.d-7f308b1e.d.ts → driver.d-ab0f126f.d.ts} +2 -2
- package/{driver.d-f55c470d.d.ts → driver.d-b8dd753f.d.ts} +2 -2
- package/{driver.d-28b0b849.d.ts → driver.d-c4dd56f7.d.ts} +2 -2
- package/{driver.d-53ed595e.d.ts → driver.d-eb654ed5.d.ts} +2 -2
- package/index.cjs +3 -3
- package/index.d.ts +4 -4
- package/index.mjs +2 -2
- package/knex/index.d.ts +1 -1
- package/kysely/index.d.ts +1 -1
- package/libsql/index.cjs +2 -2
- package/libsql/index.d.ts +5 -5
- package/libsql/index.mjs +2 -2
- package/libsql/migrator.d.ts +5 -5
- package/mysql-core/index.cjs +57 -21
- package/mysql-core/index.cjs.map +1 -1
- package/mysql-core/index.d.ts +184 -344
- package/mysql-core/index.mjs +58 -22
- package/mysql-core/index.mjs.map +1 -1
- package/mysql2/index.cjs +14 -10
- package/mysql2/index.cjs.map +1 -1
- package/mysql2/index.d.ts +16 -12
- package/mysql2/index.mjs +15 -11
- package/mysql2/index.mjs.map +1 -1
- package/mysql2/migrator.d.ts +4 -4
- package/neon-http/index.cjs +1 -1
- package/neon-http/index.d.ts +4 -4
- package/neon-http/index.mjs +2 -2
- package/neon-http/migrator.cjs +1 -1
- package/neon-http/migrator.d.ts +4 -4
- package/neon-http/migrator.mjs +1 -1
- package/neon-serverless/index.cjs +1 -1
- package/neon-serverless/index.d.ts +4 -4
- package/neon-serverless/index.mjs +2 -2
- package/neon-serverless/migrator.d.ts +4 -4
- package/node-postgres/index.cjs +1 -1
- package/node-postgres/index.d.ts +4 -4
- package/node-postgres/index.mjs +2 -2
- package/node-postgres/migrator.d.ts +4 -4
- package/package.json +3 -3
- package/pg-core/index.cjs +1 -1
- package/pg-core/index.cjs.map +1 -1
- package/pg-core/index.d.ts +207 -373
- package/pg-core/index.mjs +48 -18
- package/pg-core/index.mjs.map +1 -1
- package/planetscale-serverless/index.cjs +5 -5
- package/planetscale-serverless/index.cjs.map +1 -1
- package/planetscale-serverless/index.d.ts +5 -5
- package/planetscale-serverless/index.mjs +5 -5
- package/planetscale-serverless/index.mjs.map +1 -1
- package/planetscale-serverless/migrator.d.ts +4 -4
- package/postgres-js/index.cjs +1 -1
- package/postgres-js/index.d.ts +4 -4
- package/postgres-js/index.mjs +2 -2
- package/postgres-js/migrator.d.ts +4 -4
- package/{query-promise.d-fd15f63a.d.ts → query-promise.d-bc96befc.d.ts} +48 -45
- package/{db.d-2e828d8c.d.ts → select.types.d-570dd25a.d.ts} +281 -465
- package/{select.types.d-35b6e089.d.ts → select.types.d-73209a67.d.ts} +47 -258
- package/{select.types.d-1ea8ee3b.d.ts → select.types.d-a3c4c974.d.ts} +20 -19
- package/{db.d-9d586c00.d.ts → select.types.d-d0a10728.d.ts} +471 -731
- package/{session-c47f12d9.mjs → session-0c131cde.mjs} +2 -2
- package/{session-c47f12d9.mjs.map → session-0c131cde.mjs.map} +1 -1
- package/{session-2431f9e1.mjs → session-16f863cd.mjs} +36 -64
- package/session-16f863cd.mjs.map +1 -0
- package/{session-6bfef963.cjs → session-805d2876.cjs} +64 -131
- package/session-805d2876.cjs.map +1 -0
- package/{session-fa99bfce.mjs → session-ac71392b.mjs} +67 -134
- package/session-ac71392b.mjs.map +1 -0
- package/{session-fa9720a5.cjs → session-e9306785.cjs} +61 -71
- package/session-e9306785.cjs.map +1 -0
- package/sql-js/index.cjs +2 -2
- package/sql-js/index.d.ts +5 -5
- package/sql-js/index.mjs +2 -2
- package/sql-js/migrator.d.ts +5 -5
- package/sqlite-core/index.cjs +2 -2
- package/sqlite-core/index.d.ts +83 -137
- package/sqlite-core/index.mjs +28 -10
- package/sqlite-core/index.mjs.map +1 -1
- package/sqlite-proxy/index.cjs +2 -2
- package/sqlite-proxy/index.d.ts +6 -6
- package/sqlite-proxy/index.mjs +2 -2
- package/sqlite-proxy/migrator.cjs +1 -1
- package/sqlite-proxy/migrator.d.ts +5 -5
- package/sqlite-proxy/migrator.mjs +1 -1
- package/vercel-postgres/index.cjs +1 -1
- package/vercel-postgres/index.d.ts +4 -4
- package/vercel-postgres/index.mjs +2 -2
- package/vercel-postgres/migrator.d.ts +4 -4
- package/version.cjs +1 -1
- package/version.d.ts +1 -1
- package/version.mjs +1 -1
- package/alias-5aeeb2f5.cjs.map +0 -1
- package/alias-6eaa2e87.mjs.map +0 -1
- package/column.d-9d74a4f3.d.ts +0 -558
- package/session-2431f9e1.mjs.map +0 -1
- package/session-6bfef963.cjs.map +0 -1
- package/session-fa9720a5.cjs.map +0 -1
- package/session-fa99bfce.mjs.map +0 -1
|
@@ -1,329 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AddAliasToSelection, G as GetSelectTableName, a as GetSelectTableSelection, S as SelectMode, J as JoinNullability,
|
|
3
|
-
import { T as TablesRelationalConfig, K as TableRelationalConfig, J as DBQueryConfig, a as Relation, a2 as BuildRelationalQueryResult, U as BuildQueryResult, Q as QueryPromise, L as ExtractTablesWithRelations, R as RelationalSchemaConfig } from './query-promise.d-fd15f63a.js';
|
|
1
|
+
import { e as entityKind, aM as AnySQLiteTable, aF as KnownKeysOnly, aJ as ColumnsSelection, ah as Subquery, ai as WithSubquery, ax as DrizzleTypeError, X as SQLWrapper, Q as Query, a as SQL, aq as UpdateSet, aS as SQLiteTable, aL as SQLiteColumn, I as InferModel, G as GetColumnData, a9 as Param, S as Simplify, ad as Placeholder, b0 as IndexColumn, ay as ValueOrArray, aK as SQLiteColumnBuilder, o as BuildColumns, V as View, T as Table, b9 as SQLiteTableWithColumns, al as UpdateTableConfig, av as Assume, y as SelectedFieldsFlat$1, E as SelectedFields$1, F as SelectedFieldsOrdered$1 } from './column.d-9d2f4045.js';
|
|
2
|
+
import { A as AddAliasToSelection, T as TypedQueryBuilder, f as SelectResultFields, G as GetSelectTableName, a as GetSelectTableSelection, S as SelectMode, J as JoinNullability, B as BuildSubquerySelection, b as SelectResult, c as JoinType, M as MapColumnsToTableAlias, d as AppendToResult, e as AppendToNullabilityMap } from './select.types.d-a3c4c974.js';
|
|
4
3
|
import { MigrationMeta } from './migrator.js';
|
|
4
|
+
import { T as TablesRelationalConfig, L as TableRelationalConfig, K as DBQueryConfig, V as BuildQueryResult, Q as QueryPromise, N as ExtractTablesWithRelations, R as RelationalSchemaConfig, a as Relation, a3 as BuildRelationalQueryResult } from './query-promise.d-bc96befc.js';
|
|
5
5
|
|
|
6
|
-
declare class
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare class Check {
|
|
15
|
-
table: AnySQLiteTable;
|
|
16
|
-
static readonly [entityKind]: string;
|
|
17
|
-
_: {
|
|
18
|
-
brand: 'SQLiteCheck';
|
|
19
|
-
};
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly value: SQL;
|
|
22
|
-
constructor(table: AnySQLiteTable, builder: CheckBuilder);
|
|
23
|
-
}
|
|
24
|
-
declare function check(name: string, value: SQL): CheckBuilder;
|
|
25
|
-
|
|
26
|
-
interface IndexConfig {
|
|
27
|
-
name: string;
|
|
28
|
-
columns: IndexColumn[];
|
|
29
|
-
unique: boolean;
|
|
30
|
-
where: SQL | undefined;
|
|
31
|
-
}
|
|
32
|
-
type IndexColumn = AnySQLiteColumn | SQL;
|
|
33
|
-
declare class IndexBuilderOn {
|
|
34
|
-
private name;
|
|
35
|
-
private unique;
|
|
36
|
-
static readonly [entityKind]: string;
|
|
37
|
-
constructor(name: string, unique: boolean);
|
|
38
|
-
on(...columns: [IndexColumn, ...IndexColumn[]]): IndexBuilder;
|
|
39
|
-
}
|
|
40
|
-
declare class IndexBuilder {
|
|
6
|
+
declare class AsyncRelationalQueryBuilder<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
|
|
7
|
+
private fullSchema;
|
|
8
|
+
private schema;
|
|
9
|
+
private tableNamesMap;
|
|
10
|
+
private table;
|
|
11
|
+
private tableConfig;
|
|
12
|
+
private dialect;
|
|
13
|
+
private session;
|
|
41
14
|
static readonly [entityKind]: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
constructor(name: string, columns: IndexColumn[], unique: boolean);
|
|
46
|
-
/**
|
|
47
|
-
* Condition for partial index.
|
|
48
|
-
*/
|
|
49
|
-
where(condition: SQL): this;
|
|
15
|
+
constructor(fullSchema: Record<string, unknown>, schema: TSchema, tableNamesMap: Record<string, string>, table: AnySQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'async', unknown, TFullSchema, TSchema>);
|
|
16
|
+
findMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): SQLiteAsyncRelationalQuery<BuildQueryResult<TSchema, TFields, TConfig>[]>;
|
|
17
|
+
findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): SQLiteAsyncRelationalQuery<BuildQueryResult<TSchema, TFields, TSelection> | undefined>;
|
|
50
18
|
}
|
|
51
|
-
declare class
|
|
19
|
+
declare class SyncRelationalQueryBuilder<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
|
|
20
|
+
private fullSchema;
|
|
21
|
+
private schema;
|
|
22
|
+
private tableNamesMap;
|
|
23
|
+
private table;
|
|
24
|
+
private tableConfig;
|
|
25
|
+
private dialect;
|
|
26
|
+
private session;
|
|
52
27
|
static readonly [entityKind]: string;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
constructor(fullSchema: Record<string, unknown>, schema: TSchema, tableNamesMap: Record<string, string>, table: AnySQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'sync', unknown, TFullSchema, TSchema>);
|
|
29
|
+
prepareFindMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): {
|
|
30
|
+
execute: PreparedQuery<PreparedQueryConfig & {
|
|
31
|
+
type: 'sync';
|
|
32
|
+
all: BuildQueryResult<TSchema, TFields, TConfig>[];
|
|
33
|
+
}>['all'];
|
|
58
34
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
tableName: TTableName;
|
|
66
|
-
}>[]>(...columns: TColumns): PrimaryKeyBuilder;
|
|
67
|
-
declare class PrimaryKeyBuilder {
|
|
68
|
-
static readonly [entityKind]: string;
|
|
69
|
-
_: {
|
|
70
|
-
brand: 'SQLitePrimaryKeyBuilder';
|
|
35
|
+
findMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): BuildQueryResult<TSchema, TFields, TConfig>[];
|
|
36
|
+
prepareFindFirst<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): {
|
|
37
|
+
execute: PreparedQuery<PreparedQueryConfig & {
|
|
38
|
+
type: 'sync';
|
|
39
|
+
get: BuildQueryResult<TSchema, TFields, TConfig> | undefined;
|
|
40
|
+
}>['get'];
|
|
71
41
|
};
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
declare class PrimaryKey {
|
|
75
|
-
readonly table: AnySQLiteTable;
|
|
76
|
-
static readonly [entityKind]: string;
|
|
77
|
-
readonly columns: AnySQLiteColumn<{}>[];
|
|
78
|
-
constructor(table: AnySQLiteTable, columns: AnySQLiteColumn<{}>[]);
|
|
79
|
-
getName(): string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare function uniqueKeyName(table: AnySQLiteTable, columns: string[]): string;
|
|
83
|
-
declare function unique(name?: string): UniqueOnConstraintBuilder;
|
|
84
|
-
declare class UniqueConstraintBuilder {
|
|
85
|
-
private name?;
|
|
86
|
-
static readonly [entityKind]: string;
|
|
87
|
-
constructor(columns: AnySQLiteColumn[], name?: string | undefined);
|
|
88
|
-
}
|
|
89
|
-
declare class UniqueOnConstraintBuilder {
|
|
90
|
-
static readonly [entityKind]: string;
|
|
91
|
-
constructor(name?: string);
|
|
92
|
-
on(...columns: [AnySQLiteColumn, ...AnySQLiteColumn[]]): UniqueConstraintBuilder;
|
|
93
|
-
}
|
|
94
|
-
declare class UniqueConstraint {
|
|
95
|
-
readonly table: AnySQLiteTable;
|
|
96
|
-
static readonly [entityKind]: string;
|
|
97
|
-
readonly columns: AnySQLiteColumn<{}>[];
|
|
98
|
-
readonly name?: string;
|
|
99
|
-
constructor(table: AnySQLiteTable, columns: AnySQLiteColumn<{}>[], name?: string);
|
|
100
|
-
getName(): string | undefined;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type SQLiteTableExtraConfig = Record<string, IndexBuilder | CheckBuilder | ForeignKeyBuilder | PrimaryKeyBuilder | UniqueConstraintBuilder>;
|
|
104
|
-
type TableConfig = TableConfig$1<AnySQLiteColumn>;
|
|
105
|
-
declare class SQLiteTable<T extends TableConfig> extends Table<T> {
|
|
106
|
-
static readonly [entityKind]: string;
|
|
107
|
-
}
|
|
108
|
-
type AnySQLiteTable<TPartial extends Partial<TableConfig> = {}> = SQLiteTable<UpdateTableConfig<TableConfig, TPartial>>;
|
|
109
|
-
type SQLiteTableWithColumns<T extends TableConfig> = SQLiteTable<T> & {
|
|
110
|
-
[Key in keyof T['columns']]: T['columns'][Key];
|
|
111
|
-
};
|
|
112
|
-
interface SQLiteTableFn<TSchema extends string | undefined = undefined> {
|
|
113
|
-
<TTableName extends string, TColumnsMap extends Record<string, AnySQLiteColumnBuilder>>(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns<TTableName, TColumnsMap>) => SQLiteTableExtraConfig): SQLiteTableWithColumns<{
|
|
114
|
-
name: TTableName;
|
|
115
|
-
schema: TSchema;
|
|
116
|
-
columns: BuildColumns<TTableName, TColumnsMap>;
|
|
117
|
-
}>;
|
|
42
|
+
findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): BuildQueryResult<TSchema, TFields, TSelection> | undefined;
|
|
118
43
|
}
|
|
119
|
-
declare
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
static readonly [entityKind]: string;
|
|
130
|
-
_: {
|
|
131
|
-
brand: 'SQLiteForeignKeyBuilder';
|
|
132
|
-
foreignTableName: 'TForeignTableName';
|
|
133
|
-
};
|
|
134
|
-
constructor(config: () => {
|
|
135
|
-
columns: AnySQLiteColumn[];
|
|
136
|
-
foreignColumns: AnySQLiteColumn[];
|
|
137
|
-
}, actions?: {
|
|
138
|
-
onUpdate?: UpdateDeleteAction;
|
|
139
|
-
onDelete?: UpdateDeleteAction;
|
|
140
|
-
} | undefined);
|
|
141
|
-
onUpdate(action: UpdateDeleteAction): this;
|
|
142
|
-
onDelete(action: UpdateDeleteAction): this;
|
|
143
|
-
}
|
|
144
|
-
declare class ForeignKey {
|
|
145
|
-
readonly table: AnySQLiteTable;
|
|
44
|
+
declare class SQLiteRelationalQuery<TResultKind extends 'sync' | 'async', TResult> {
|
|
45
|
+
private fullSchema;
|
|
46
|
+
private schema;
|
|
47
|
+
private tableNamesMap;
|
|
48
|
+
private table;
|
|
49
|
+
private tableConfig;
|
|
50
|
+
private dialect;
|
|
51
|
+
private session;
|
|
52
|
+
private config;
|
|
53
|
+
private mode;
|
|
146
54
|
static readonly [entityKind]: string;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
type ColumnsWithTable<TTableName extends string, TColumns extends AnySQLiteColumn[]> = {
|
|
154
|
-
[Key in keyof TColumns]: AnySQLiteColumn<{
|
|
155
|
-
tableName: TTableName;
|
|
55
|
+
protected $brand: 'SQLiteRelationalQuery';
|
|
56
|
+
constructor(fullSchema: Record<string, unknown>, schema: TablesRelationalConfig, tableNamesMap: Record<string, string>, table: AnySQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<TResultKind, unknown, Record<string, unknown>, TablesRelationalConfig>, config: DBQueryConfig<'many', true> | true, mode: 'many' | 'first');
|
|
57
|
+
prepare(): PreparedQuery<PreparedQueryConfig & {
|
|
58
|
+
type: TResultKind;
|
|
59
|
+
all: TResult;
|
|
60
|
+
get: TResult;
|
|
156
61
|
}>;
|
|
157
|
-
|
|
158
|
-
declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [AnySQLiteColumn<{
|
|
159
|
-
tableName: TTableName;
|
|
160
|
-
}>, ...AnySQLiteColumn<{
|
|
161
|
-
tableName: TTableName;
|
|
162
|
-
}>[]]>(config: () => {
|
|
163
|
-
columns: TColumns;
|
|
164
|
-
foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
|
|
165
|
-
}): ForeignKeyBuilder;
|
|
166
|
-
|
|
167
|
-
interface ReferenceConfig {
|
|
168
|
-
ref: () => AnySQLiteColumn;
|
|
169
|
-
actions: {
|
|
170
|
-
onUpdate?: UpdateDeleteAction;
|
|
171
|
-
onDelete?: UpdateDeleteAction;
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
interface SQLiteColumnBuilderHKT extends ColumnBuilderHKTBase {
|
|
175
|
-
_type: SQLiteColumnBuilder<SQLiteColumnBuilderHKT, Assume<this['config'], ColumnBuilderBaseConfig>>;
|
|
176
|
-
_columnHKT: SQLiteColumnHKT;
|
|
177
|
-
}
|
|
178
|
-
interface SQLiteColumnHKT extends ColumnHKTBase {
|
|
179
|
-
_type: SQLiteColumn<SQLiteColumnHKT, Assume<this['config'], ColumnBaseConfig>>;
|
|
180
|
-
}
|
|
181
|
-
declare abstract class SQLiteColumnBuilder<THKT extends ColumnBuilderHKTBase, T extends ColumnBuilderBaseConfig, TRuntimeConfig extends object = {}, TTypeConfig extends object = {}> extends ColumnBuilder<THKT, T, TRuntimeConfig, TTypeConfig & {
|
|
182
|
-
sqliteBrand: 'SQLiteColumnBuilder';
|
|
183
|
-
}> {
|
|
184
|
-
static readonly [entityKind]: string;
|
|
185
|
-
private foreignKeyConfigs;
|
|
186
|
-
references(ref: ReferenceConfig['ref'], actions?: ReferenceConfig['actions']): this;
|
|
187
|
-
unique(name?: string): this;
|
|
62
|
+
execute(): Result<TResultKind, TResult>;
|
|
188
63
|
}
|
|
189
|
-
|
|
190
|
-
declare abstract class SQLiteColumn<THKT extends ColumnHKT, T extends ColumnBaseConfig, TRuntimeConfig extends object = {}> extends Column<THKT, T, TRuntimeConfig, {
|
|
191
|
-
sqliteBrand: 'SQLiteColumn';
|
|
192
|
-
}> {
|
|
193
|
-
readonly table: AnySQLiteTable;
|
|
194
|
-
static readonly [entityKind]: string;
|
|
195
|
-
constructor(table: AnySQLiteTable, config: ColumnBuilderRuntimeConfig<T['data']> & TRuntimeConfig);
|
|
64
|
+
interface SQLiteAsyncRelationalQuery<TResult> extends SQLiteRelationalQuery<'async', TResult>, QueryPromise<TResult> {
|
|
196
65
|
}
|
|
197
|
-
type AnySQLiteColumn<TPartial extends Partial<ColumnBaseConfig> = {}> = SQLiteColumn<SQLiteColumnHKT, Required<Update<ColumnBaseConfig, TPartial>>>;
|
|
198
66
|
|
|
199
|
-
type SubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = Subquery<TAlias, AddAliasToSelection<TSelection, TAlias>> & AddAliasToSelection<TSelection, TAlias>;
|
|
200
|
-
type WithSubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = WithSubquery<TAlias, AddAliasToSelection<TSelection, TAlias>> & AddAliasToSelection<TSelection, TAlias>;
|
|
67
|
+
type SubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = Subquery<TAlias, AddAliasToSelection<TSelection, TAlias, 'sqlite'>> & AddAliasToSelection<TSelection, TAlias, 'sqlite'>;
|
|
68
|
+
type WithSubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = WithSubquery<TAlias, AddAliasToSelection<TSelection, TAlias, 'sqlite'>> & AddAliasToSelection<TSelection, TAlias, 'sqlite'>;
|
|
201
69
|
|
|
202
|
-
|
|
203
|
-
declare class SQLiteSelectBuilder<TSelection extends SelectedFields | undefined, TResultType extends 'sync' | 'async', TRunResult, TBuilderMode extends 'db' | 'qb' = 'db'> {
|
|
204
|
-
static readonly [entityKind]: string;
|
|
205
|
-
private fields;
|
|
206
|
-
private session;
|
|
207
|
-
private dialect;
|
|
208
|
-
private withList;
|
|
209
|
-
private distinct;
|
|
210
|
-
constructor(config: {
|
|
211
|
-
fields: TSelection;
|
|
212
|
-
session: SQLiteSession<any, any, any, any> | undefined;
|
|
213
|
-
dialect: SQLiteDialect;
|
|
214
|
-
withList?: Subquery[];
|
|
215
|
-
distinct?: boolean;
|
|
216
|
-
});
|
|
217
|
-
from<TFrom extends AnySQLiteTable | Subquery | SQLiteViewBase | SQL>(source: TFrom): CreateSQLiteSelectFromBuilderMode<TBuilderMode, GetSelectTableName<TFrom>, TResultType, TRunResult, TSelection extends undefined ? GetSelectTableSelection<TFrom> : TSelection, TSelection extends undefined ? 'single' : 'partial'>;
|
|
218
|
-
}
|
|
219
|
-
declare abstract class SQLiteSelectQueryBuilder<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends TypedQueryBuilder<BuildSubquerySelection<TSelection, TNullabilityMap>, SelectResult<TSelection, TSelectMode, TNullabilityMap>[]> {
|
|
70
|
+
declare class BaseSQLiteDatabase<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = ExtractTablesWithRelations<TFullSchema>> {
|
|
220
71
|
static readonly [entityKind]: string;
|
|
221
72
|
readonly _: {
|
|
222
|
-
readonly
|
|
223
|
-
readonly
|
|
224
|
-
readonly result: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
225
|
-
readonly selectedFields: BuildSubquerySelection<TSelection, TNullabilityMap>;
|
|
73
|
+
readonly schema: TSchema | undefined;
|
|
74
|
+
readonly tableNamesMap: Record<string, string>;
|
|
226
75
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
264
|
-
type: TResultType;
|
|
265
|
-
run: TRunResult;
|
|
266
|
-
all: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
267
|
-
get: SelectResult<TSelection, TSelectMode, TNullabilityMap>;
|
|
268
|
-
values: any[][];
|
|
269
|
-
}>;
|
|
270
|
-
run: ReturnType<this['prepare']>['run'];
|
|
271
|
-
all: ReturnType<this['prepare']>['all'];
|
|
272
|
-
get: ReturnType<this['prepare']>['get'];
|
|
273
|
-
values: ReturnType<this['prepare']>['values'];
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
interface Join {
|
|
277
|
-
on: SQL | undefined;
|
|
278
|
-
table: AnySQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
279
|
-
alias: string | undefined;
|
|
280
|
-
joinType: JoinType;
|
|
281
|
-
}
|
|
282
|
-
type AnySQLiteSelect = SQLiteSelect<any, any, any, any, any, any>;
|
|
283
|
-
type BuildAliasTable<TTable extends Table | View, TAlias extends string> = TTable extends Table ? SQLiteTableWithColumns<Assume<UpdateTableConfig<TTable['_']['config'], {
|
|
284
|
-
name: TAlias;
|
|
285
|
-
columns: MapColumnsToTableAlias<TTable['_']['columns'], TAlias>;
|
|
286
|
-
}>, TableConfig>> : TTable extends View ? SQLiteViewWithSelection<TAlias, TTable['_']['existing'], MapColumnsToTableAlias<TTable['_']['selectedFields'], TAlias>> : never;
|
|
287
|
-
interface SQLiteSelectConfig {
|
|
288
|
-
withList?: Subquery[];
|
|
289
|
-
fields: Record<string, unknown>;
|
|
290
|
-
fieldsFlat?: SelectedFieldsOrdered;
|
|
291
|
-
where?: SQL;
|
|
292
|
-
having?: SQL;
|
|
293
|
-
table: AnySQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
294
|
-
limit?: number | Placeholder;
|
|
295
|
-
offset?: number | Placeholder;
|
|
296
|
-
joins?: Join[];
|
|
297
|
-
orderBy?: (AnySQLiteColumn | SQL | SQL.Aliased)[];
|
|
298
|
-
groupBy?: (AnySQLiteColumn | SQL | SQL.Aliased)[];
|
|
299
|
-
distinct?: boolean;
|
|
300
|
-
}
|
|
301
|
-
type JoinFn<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelectMode extends SelectMode, TJoinType extends JoinType, TSelection, TNullabilityMap extends Record<string, JoinNullability>> = <TJoinedTable extends AnySQLiteTable | Subquery | SQLiteViewBase | SQL, TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, on: ((aliases: TSelection) => SQL | undefined) | SQL | undefined) => SQLiteSelectKind<THKT, TTableName, TResultType, TRunResult, AppendToResult<TTableName, TSelection, TJoinedName, TJoinedTable extends AnySQLiteTable ? TJoinedTable['_']['columns'] : TJoinedTable extends Subquery | View ? Assume<TJoinedTable['_']['selectedFields'], SelectedFields> : never, TSelectMode>, TSelectMode extends 'partial' ? TSelectMode : 'multiple', AppendToNullabilityMap<TNullabilityMap, TJoinedName, TJoinType>>;
|
|
302
|
-
type SelectedFieldsFlat = SelectedFieldsFlat$1<AnySQLiteColumn>;
|
|
303
|
-
type SelectedFields = SelectedFields$1<AnySQLiteColumn, AnySQLiteTable>;
|
|
304
|
-
type SelectedFieldsOrdered = SelectedFieldsOrdered$1<AnySQLiteColumn>;
|
|
305
|
-
interface SQLiteSelectHKTBase {
|
|
306
|
-
tableName: string | undefined;
|
|
307
|
-
resultType: 'sync' | 'async';
|
|
308
|
-
runResult: unknown;
|
|
309
|
-
selection: unknown;
|
|
310
|
-
selectMode: SelectMode;
|
|
311
|
-
nullabilityMap: unknown;
|
|
312
|
-
_type: unknown;
|
|
313
|
-
}
|
|
314
|
-
type SQLiteSelectKind<T extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability>> = (T & {
|
|
315
|
-
tableName: TTableName;
|
|
316
|
-
resultType: TResultType;
|
|
317
|
-
runResult: TRunResult;
|
|
318
|
-
selection: TSelection;
|
|
319
|
-
selectMode: TSelectMode;
|
|
320
|
-
nullabilityMap: TNullabilityMap;
|
|
321
|
-
})['_type'];
|
|
322
|
-
interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase {
|
|
323
|
-
_type: SQLiteSelectQueryBuilder<this, this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
324
|
-
}
|
|
325
|
-
interface SQLiteSelectHKT extends SQLiteSelectHKTBase {
|
|
326
|
-
_type: SQLiteSelect<this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
76
|
+
query: TFullSchema extends Record<string, never> ? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'> : {
|
|
77
|
+
[K in keyof TSchema]: TResultKind extends 'async' ? AsyncRelationalQueryBuilder<TFullSchema, TSchema, TSchema[K]> : SyncRelationalQueryBuilder<TFullSchema, TSchema, TSchema[K]>;
|
|
78
|
+
};
|
|
79
|
+
constructor(resultKind: TResultKind,
|
|
80
|
+
/** @internal */
|
|
81
|
+
dialect: {
|
|
82
|
+
sync: SQLiteSyncDialect;
|
|
83
|
+
async: SQLiteAsyncDialect;
|
|
84
|
+
}[TResultKind],
|
|
85
|
+
/** @internal */
|
|
86
|
+
session: SQLiteSession<TResultKind, TRunResult, TFullSchema, TSchema>, schema: RelationalSchemaConfig<TSchema> | undefined);
|
|
87
|
+
$with<TAlias extends string>(alias: TAlias): {
|
|
88
|
+
as<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection, unknown> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection, unknown>)): WithSubqueryWithSelection<TSelection, TAlias>;
|
|
89
|
+
};
|
|
90
|
+
with(...queries: WithSubquery[]): {
|
|
91
|
+
select: {
|
|
92
|
+
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
93
|
+
<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult, "db">;
|
|
94
|
+
};
|
|
95
|
+
selectDistinct: {
|
|
96
|
+
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
97
|
+
<TSelection_1 extends SelectedFields>(fields: TSelection_1): SQLiteSelectBuilder<TSelection_1, TResultKind, TRunResult, "db">;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
select(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
101
|
+
select<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
|
|
102
|
+
selectDistinct(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
103
|
+
selectDistinct<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
|
|
104
|
+
update<TTable extends AnySQLiteTable>(table: TTable): SQLiteUpdateBuilder<TTable, TResultKind, TRunResult>;
|
|
105
|
+
insert<TTable extends AnySQLiteTable>(into: TTable): SQLiteInsertBuilder<TTable, TResultKind, TRunResult>;
|
|
106
|
+
delete<TTable extends AnySQLiteTable>(from: TTable): SQLiteDelete<TTable, TResultKind, TRunResult>;
|
|
107
|
+
run(query: SQLWrapper): Result<TResultKind, TRunResult>;
|
|
108
|
+
all<T = unknown>(query: SQLWrapper): Result<TResultKind, T[]>;
|
|
109
|
+
get<T = unknown>(query: SQLWrapper): Result<TResultKind, T>;
|
|
110
|
+
values<T extends unknown[] = unknown[]>(query: SQLWrapper): Result<TResultKind, T[]>;
|
|
111
|
+
transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
|
|
327
112
|
}
|
|
328
113
|
|
|
329
114
|
interface PreparedQueryConfig {
|
|
@@ -396,14 +181,58 @@ declare abstract class SQLiteTransaction<TResultType extends 'sync' | 'async', T
|
|
|
396
181
|
rollback(): never;
|
|
397
182
|
}
|
|
398
183
|
|
|
184
|
+
declare abstract class SQLiteDialect {
|
|
185
|
+
static readonly [entityKind]: string;
|
|
186
|
+
escapeName(name: string): string;
|
|
187
|
+
escapeParam(_num: number): string;
|
|
188
|
+
escapeString(str: string): string;
|
|
189
|
+
buildDeleteQuery({ table, where, returning }: SQLiteDeleteConfig): SQL;
|
|
190
|
+
buildUpdateSet(table: AnySQLiteTable, set: UpdateSet): SQL;
|
|
191
|
+
buildUpdateQuery({ table, set, where, returning }: SQLiteUpdateConfig): SQL;
|
|
192
|
+
/**
|
|
193
|
+
* Builds selection SQL with provided fields/expressions
|
|
194
|
+
*
|
|
195
|
+
* Examples:
|
|
196
|
+
*
|
|
197
|
+
* `select <selection> from`
|
|
198
|
+
*
|
|
199
|
+
* `insert ... returning <selection>`
|
|
200
|
+
*
|
|
201
|
+
* If `isSingleTable` is true, then columns won't be prefixed with table name
|
|
202
|
+
*/
|
|
203
|
+
private buildSelection;
|
|
204
|
+
buildSelectQuery({ withList, fields, fieldsFlat, where, having, table, joins, orderBy, groupBy, limit, offset, distinct }: SQLiteSelectConfig): SQL;
|
|
205
|
+
buildInsertQuery({ table, values, onConflict, returning }: SQLiteInsertConfig): SQL;
|
|
206
|
+
sqlToQuery(sql: SQL): Query;
|
|
207
|
+
buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
208
|
+
fullSchema: Record<string, unknown>;
|
|
209
|
+
schema: TablesRelationalConfig;
|
|
210
|
+
tableNamesMap: Record<string, string>;
|
|
211
|
+
table: AnySQLiteTable;
|
|
212
|
+
tableConfig: TableRelationalConfig;
|
|
213
|
+
queryConfig: true | DBQueryConfig<'many', true>;
|
|
214
|
+
tableAlias: string;
|
|
215
|
+
nestedQueryRelation?: Relation;
|
|
216
|
+
joinOn?: SQL;
|
|
217
|
+
}): BuildRelationalQueryResult<SQLiteTable, SQLiteColumn>;
|
|
218
|
+
}
|
|
219
|
+
declare class SQLiteSyncDialect extends SQLiteDialect {
|
|
220
|
+
static readonly [entityKind]: string;
|
|
221
|
+
migrate(migrations: MigrationMeta[], session: SQLiteSession<'sync', unknown, Record<string, unknown>, TablesRelationalConfig>): void;
|
|
222
|
+
}
|
|
223
|
+
declare class SQLiteAsyncDialect extends SQLiteDialect {
|
|
224
|
+
static readonly [entityKind]: string;
|
|
225
|
+
migrate(migrations: MigrationMeta[], session: SQLiteSession<'async', unknown, Record<string, unknown>, TablesRelationalConfig>): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
|
|
399
228
|
interface SQLiteDeleteConfig {
|
|
400
229
|
where?: SQL | undefined;
|
|
401
|
-
table:
|
|
230
|
+
table: SQLiteTable;
|
|
402
231
|
returning?: SelectedFieldsOrdered;
|
|
403
232
|
}
|
|
404
|
-
interface SQLiteDelete<TTable extends
|
|
233
|
+
interface SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper {
|
|
405
234
|
}
|
|
406
|
-
declare class SQLiteDelete<TTable extends
|
|
235
|
+
declare class SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> implements SQLWrapper {
|
|
407
236
|
private table;
|
|
408
237
|
private session;
|
|
409
238
|
private dialect;
|
|
@@ -433,9 +262,9 @@ interface SQLiteUpdateConfig {
|
|
|
433
262
|
table: AnySQLiteTable;
|
|
434
263
|
returning?: SelectedFieldsOrdered;
|
|
435
264
|
}
|
|
436
|
-
type SQLiteUpdateSetSource<TTable extends AnySQLiteTable> =
|
|
265
|
+
type SQLiteUpdateSetSource<TTable extends AnySQLiteTable> = {
|
|
437
266
|
[Key in keyof TTable['_']['columns']]?: GetColumnData<TTable['_']['columns'][Key], 'query'> | SQL;
|
|
438
|
-
}
|
|
267
|
+
} & {};
|
|
439
268
|
declare class SQLiteUpdateBuilder<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult> {
|
|
440
269
|
protected table: TTable;
|
|
441
270
|
protected session: SQLiteSession<any, any, any, any>;
|
|
@@ -461,7 +290,10 @@ declare class SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 's
|
|
|
461
290
|
where(where: SQL | undefined): Omit<this, 'where'>;
|
|
462
291
|
returning(): Omit<SQLiteUpdate<TTable, TResultType, TRunResult, InferModel<TTable>>, 'where' | 'returning'>;
|
|
463
292
|
returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): Omit<SQLiteUpdate<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>, 'where' | 'returning'>;
|
|
464
|
-
toSQL():
|
|
293
|
+
toSQL(): {
|
|
294
|
+
sql: Query['sql'];
|
|
295
|
+
params: Query['params'];
|
|
296
|
+
};
|
|
465
297
|
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
466
298
|
type: TResultType;
|
|
467
299
|
run: TRunResult;
|
|
@@ -518,7 +350,10 @@ declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 's
|
|
|
518
350
|
where?: SQL;
|
|
519
351
|
set: SQLiteUpdateSetSource<TTable>;
|
|
520
352
|
}): this;
|
|
521
|
-
toSQL(): Simplify<
|
|
353
|
+
toSQL(): Simplify<{
|
|
354
|
+
sql: Query['sql'];
|
|
355
|
+
params: Query['params'];
|
|
356
|
+
}>;
|
|
522
357
|
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
523
358
|
type: TResultType;
|
|
524
359
|
run: TRunResult;
|
|
@@ -532,6 +367,83 @@ declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 's
|
|
|
532
367
|
values: ReturnType<this['prepare']>['values'];
|
|
533
368
|
}
|
|
534
369
|
|
|
370
|
+
type CreateSQLiteSelectFromBuilderMode<TBuilderMode extends 'db' | 'qb', TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode> = TBuilderMode extends 'db' ? SQLiteSelect<TTableName, TResultType, TRunResult, TSelection, TSelectMode> : SQLiteSelectQueryBuilder<SQLiteSelectQueryBuilderHKT, TTableName, TResultType, TRunResult, TSelection, TSelectMode>;
|
|
371
|
+
declare class SQLiteSelectBuilder<TSelection extends SelectedFields | undefined, TResultType extends 'sync' | 'async', TRunResult, TBuilderMode extends 'db' | 'qb' = 'db'> {
|
|
372
|
+
static readonly [entityKind]: string;
|
|
373
|
+
private fields;
|
|
374
|
+
private session;
|
|
375
|
+
private dialect;
|
|
376
|
+
private withList;
|
|
377
|
+
private distinct;
|
|
378
|
+
constructor(config: {
|
|
379
|
+
fields: TSelection;
|
|
380
|
+
session: SQLiteSession<any, any, any, any> | undefined;
|
|
381
|
+
dialect: SQLiteDialect;
|
|
382
|
+
withList?: Subquery[];
|
|
383
|
+
distinct?: boolean;
|
|
384
|
+
});
|
|
385
|
+
from<TFrom extends AnySQLiteTable | Subquery | SQLiteViewBase | SQL>(source: TFrom): CreateSQLiteSelectFromBuilderMode<TBuilderMode, GetSelectTableName<TFrom>, TResultType, TRunResult, TSelection extends undefined ? GetSelectTableSelection<TFrom> : TSelection, TSelection extends undefined ? 'single' : 'partial'>;
|
|
386
|
+
}
|
|
387
|
+
declare abstract class SQLiteSelectQueryBuilder<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends TypedQueryBuilder<BuildSubquerySelection<TSelection, TNullabilityMap>, SelectResult<TSelection, TSelectMode, TNullabilityMap>[]> {
|
|
388
|
+
static readonly [entityKind]: string;
|
|
389
|
+
readonly _: {
|
|
390
|
+
readonly selectMode: TSelectMode;
|
|
391
|
+
readonly selection: TSelection;
|
|
392
|
+
readonly result: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
393
|
+
readonly selectedFields: BuildSubquerySelection<TSelection, TNullabilityMap>;
|
|
394
|
+
};
|
|
395
|
+
protected config: SQLiteSelectConfig;
|
|
396
|
+
protected joinsNotNullableMap: Record<string, boolean>;
|
|
397
|
+
private tableName;
|
|
398
|
+
private isPartialSelect;
|
|
399
|
+
protected session: SQLiteSession<any, any, any, any> | undefined;
|
|
400
|
+
protected dialect: SQLiteDialect;
|
|
401
|
+
constructor({ table, fields, isPartialSelect, session, dialect, withList, distinct }: {
|
|
402
|
+
table: SQLiteSelectConfig['table'];
|
|
403
|
+
fields: SQLiteSelectConfig['fields'];
|
|
404
|
+
isPartialSelect: boolean;
|
|
405
|
+
session: SQLiteSession<any, any, any, any> | undefined;
|
|
406
|
+
dialect: SQLiteDialect;
|
|
407
|
+
withList: Subquery[] | undefined;
|
|
408
|
+
distinct: boolean | undefined;
|
|
409
|
+
});
|
|
410
|
+
private createJoin;
|
|
411
|
+
leftJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "left", TSelection, TNullabilityMap>;
|
|
412
|
+
rightJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "right", TSelection, TNullabilityMap>;
|
|
413
|
+
innerJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "inner", TSelection, TNullabilityMap>;
|
|
414
|
+
fullJoin: JoinFn<THKT, TTableName, TResultType, TRunResult, TSelectMode, "full", TSelection, TNullabilityMap>;
|
|
415
|
+
where(where: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
|
|
416
|
+
having(having: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
|
|
417
|
+
groupBy(builder: (aliases: TSelection) => ValueOrArray<SQLiteColumn | SQL | SQL.Aliased>): this;
|
|
418
|
+
groupBy(...columns: (SQLiteColumn | SQL)[]): this;
|
|
419
|
+
orderBy(builder: (aliases: TSelection) => ValueOrArray<SQLiteColumn | SQL | SQL.Aliased>): this;
|
|
420
|
+
orderBy(...columns: (SQLiteColumn | SQL)[]): this;
|
|
421
|
+
limit(limit: number | Placeholder): this;
|
|
422
|
+
offset(offset: number | Placeholder): this;
|
|
423
|
+
toSQL(): {
|
|
424
|
+
sql: Query['sql'];
|
|
425
|
+
params: Query['params'];
|
|
426
|
+
};
|
|
427
|
+
as<TAlias extends string>(alias: TAlias): SubqueryWithSelection<BuildSubquerySelection<TSelection, TNullabilityMap>, TAlias>;
|
|
428
|
+
getSelectedFields(): BuildSubquerySelection<TSelection, TNullabilityMap>;
|
|
429
|
+
}
|
|
430
|
+
interface SQLiteSelect<TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection extends ColumnsSelection, TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends SQLiteSelectQueryBuilder<SQLiteSelectHKT, TTableName | undefined, TResultType, TRunResult, TSelection, TSelectMode, TNullabilityMap> {
|
|
431
|
+
}
|
|
432
|
+
declare class SQLiteSelect<TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends SQLiteSelectQueryBuilder<SQLiteSelectHKT, TTableName, TResultType, TRunResult, TSelection, TSelectMode, TNullabilityMap> {
|
|
433
|
+
static readonly [entityKind]: string;
|
|
434
|
+
prepare(isOneTimeQuery?: boolean): PreparedQuery<{
|
|
435
|
+
type: TResultType;
|
|
436
|
+
run: TRunResult;
|
|
437
|
+
all: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
|
|
438
|
+
get: SelectResult<TSelection, TSelectMode, TNullabilityMap>;
|
|
439
|
+
values: any[][];
|
|
440
|
+
}>;
|
|
441
|
+
run: ReturnType<this['prepare']>['run'];
|
|
442
|
+
all: ReturnType<this['prepare']>['all'];
|
|
443
|
+
get: ReturnType<this['prepare']>['get'];
|
|
444
|
+
values: ReturnType<this['prepare']>['values'];
|
|
445
|
+
}
|
|
446
|
+
|
|
535
447
|
declare class QueryBuilder {
|
|
536
448
|
static readonly [entityKind]: string;
|
|
537
449
|
private dialect;
|
|
@@ -578,17 +490,17 @@ declare class ViewBuilder<TName extends string = string> extends ViewBuilderCore
|
|
|
578
490
|
name: TName;
|
|
579
491
|
}> {
|
|
580
492
|
static readonly [entityKind]: string;
|
|
581
|
-
as<TSelection extends SelectedFields>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): SQLiteViewWithSelection<TName, false, AddAliasToSelection<TSelection, TName>>;
|
|
493
|
+
as<TSelection extends SelectedFields>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): SQLiteViewWithSelection<TName, false, AddAliasToSelection<TSelection, TName, 'sqlite'>>;
|
|
582
494
|
}
|
|
583
|
-
declare class ManualViewBuilder<TName extends string = string, TColumns extends Record<string,
|
|
495
|
+
declare class ManualViewBuilder<TName extends string = string, TColumns extends Record<string, SQLiteColumnBuilder> = Record<string, SQLiteColumnBuilder>> extends ViewBuilderCore<{
|
|
584
496
|
name: TName;
|
|
585
497
|
columns: TColumns;
|
|
586
498
|
}> {
|
|
587
499
|
static readonly [entityKind]: string;
|
|
588
500
|
private columns;
|
|
589
501
|
constructor(name: TName, columns: TColumns);
|
|
590
|
-
existing(): SQLiteViewWithSelection<TName, true, BuildColumns<TName, TColumns>>;
|
|
591
|
-
as(query: SQL): SQLiteViewWithSelection<TName, false, BuildColumns<TName, TColumns>>;
|
|
502
|
+
existing(): SQLiteViewWithSelection<TName, true, BuildColumns<TName, TColumns, 'sqlite'>>;
|
|
503
|
+
as(query: SQL): SQLiteViewWithSelection<TName, false, BuildColumns<TName, TColumns, 'sqlite'>>;
|
|
592
504
|
}
|
|
593
505
|
declare abstract class SQLiteViewBase<TName extends string = string, TExisting extends boolean = boolean, TSelection extends ColumnsSelection = ColumnsSelection> extends View<TName, TExisting, TSelection> {
|
|
594
506
|
static readonly [entityKind]: string;
|
|
@@ -611,156 +523,60 @@ declare class SQLiteView<TName extends string = string, TExisting extends boolea
|
|
|
611
523
|
}
|
|
612
524
|
type SQLiteViewWithSelection<TName extends string, TExisting extends boolean, TSelection extends ColumnsSelection> = SQLiteView<TName, TExisting, TSelection> & TSelection;
|
|
613
525
|
declare function sqliteView<TName extends string>(name: TName): ViewBuilder<TName>;
|
|
614
|
-
declare function sqliteView<TName extends string, TColumns extends Record<string,
|
|
526
|
+
declare function sqliteView<TName extends string, TColumns extends Record<string, SQLiteColumnBuilder>>(name: TName, columns: TColumns): ManualViewBuilder<TName, TColumns>;
|
|
615
527
|
declare const view: typeof sqliteView;
|
|
616
528
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
buildDeleteQuery({ table, where, returning }: SQLiteDeleteConfig): SQL;
|
|
623
|
-
buildUpdateSet(table: AnySQLiteTable, set: UpdateSet): SQL;
|
|
624
|
-
buildUpdateQuery({ table, set, where, returning }: SQLiteUpdateConfig): SQL;
|
|
625
|
-
/**
|
|
626
|
-
* Builds selection SQL with provided fields/expressions
|
|
627
|
-
*
|
|
628
|
-
* Examples:
|
|
629
|
-
*
|
|
630
|
-
* `select <selection> from`
|
|
631
|
-
*
|
|
632
|
-
* `insert ... returning <selection>`
|
|
633
|
-
*
|
|
634
|
-
* If `isSingleTable` is true, then columns won't be prefixed with table name
|
|
635
|
-
*/
|
|
636
|
-
private buildSelection;
|
|
637
|
-
buildSelectQuery({ withList, fields, fieldsFlat, where, having, table, joins, orderBy, groupBy, limit, offset, distinct }: SQLiteSelectConfig): SQL;
|
|
638
|
-
buildInsertQuery({ table, values, onConflict, returning }: SQLiteInsertConfig): SQL;
|
|
639
|
-
sqlToQuery(sql: SQL): Query;
|
|
640
|
-
buildRelationalQuery({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: {
|
|
641
|
-
fullSchema: Record<string, unknown>;
|
|
642
|
-
schema: TablesRelationalConfig;
|
|
643
|
-
tableNamesMap: Record<string, string>;
|
|
644
|
-
table: AnySQLiteTable;
|
|
645
|
-
tableConfig: TableRelationalConfig;
|
|
646
|
-
queryConfig: true | DBQueryConfig<'many', true>;
|
|
647
|
-
tableAlias: string;
|
|
648
|
-
nestedQueryRelation?: Relation;
|
|
649
|
-
joinOn?: SQL;
|
|
650
|
-
}): BuildRelationalQueryResult<AnySQLiteTable, AnySQLiteColumn>;
|
|
651
|
-
}
|
|
652
|
-
declare class SQLiteSyncDialect extends SQLiteDialect {
|
|
653
|
-
static readonly [entityKind]: string;
|
|
654
|
-
migrate(migrations: MigrationMeta[], session: SQLiteSession<'sync', unknown, Record<string, unknown>, TablesRelationalConfig>): void;
|
|
655
|
-
}
|
|
656
|
-
declare class SQLiteAsyncDialect extends SQLiteDialect {
|
|
657
|
-
static readonly [entityKind]: string;
|
|
658
|
-
migrate(migrations: MigrationMeta[], session: SQLiteSession<'async', unknown, Record<string, unknown>, TablesRelationalConfig>): Promise<void>;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
declare class AsyncRelationalQueryBuilder<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
|
|
662
|
-
private fullSchema;
|
|
663
|
-
private schema;
|
|
664
|
-
private tableNamesMap;
|
|
665
|
-
private table;
|
|
666
|
-
private tableConfig;
|
|
667
|
-
private dialect;
|
|
668
|
-
private session;
|
|
669
|
-
static readonly [entityKind]: string;
|
|
670
|
-
constructor(fullSchema: Record<string, unknown>, schema: TSchema, tableNamesMap: Record<string, string>, table: AnySQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'async', unknown, TFullSchema, TSchema>);
|
|
671
|
-
findMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): SQLiteAsyncRelationalQuery<BuildQueryResult<TSchema, TFields, TConfig>[]>;
|
|
672
|
-
findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): SQLiteAsyncRelationalQuery<BuildQueryResult<TSchema, TFields, TSelection> | undefined>;
|
|
529
|
+
interface Join {
|
|
530
|
+
on: SQL | undefined;
|
|
531
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
532
|
+
alias: string | undefined;
|
|
533
|
+
joinType: JoinType;
|
|
673
534
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
execute: PreparedQuery<PreparedQueryConfig & {
|
|
693
|
-
type: 'sync';
|
|
694
|
-
get: BuildQueryResult<TSchema, TFields, TConfig> | undefined;
|
|
695
|
-
}>['get'];
|
|
696
|
-
};
|
|
697
|
-
findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): BuildQueryResult<TSchema, TFields, TSelection> | undefined;
|
|
535
|
+
type AnySQLiteSelect = SQLiteSelect<any, any, any, any, any, any>;
|
|
536
|
+
type BuildAliasTable<TTable extends SQLiteTable | View, TAlias extends string> = TTable extends Table ? SQLiteTableWithColumns<UpdateTableConfig<TTable['_']['config'], {
|
|
537
|
+
name: TAlias;
|
|
538
|
+
columns: MapColumnsToTableAlias<TTable['_']['columns'], TAlias, 'sqlite'>;
|
|
539
|
+
}>> : TTable extends View ? SQLiteViewWithSelection<TAlias, TTable['_']['existing'], MapColumnsToTableAlias<TTable['_']['selectedFields'], TAlias, 'sqlite'>> : never;
|
|
540
|
+
interface SQLiteSelectConfig {
|
|
541
|
+
withList?: Subquery[];
|
|
542
|
+
fields: Record<string, unknown>;
|
|
543
|
+
fieldsFlat?: SelectedFieldsOrdered;
|
|
544
|
+
where?: SQL;
|
|
545
|
+
having?: SQL;
|
|
546
|
+
table: SQLiteTable | Subquery | SQLiteViewBase | SQL;
|
|
547
|
+
limit?: number | Placeholder;
|
|
548
|
+
offset?: number | Placeholder;
|
|
549
|
+
joins?: Join[];
|
|
550
|
+
orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
551
|
+
groupBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
|
|
552
|
+
distinct?: boolean;
|
|
698
553
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
constructor(fullSchema: Record<string, unknown>, schema: TablesRelationalConfig, tableNamesMap: Record<string, string>, table: AnySQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<TResultKind, unknown, Record<string, unknown>, TablesRelationalConfig>, config: DBQueryConfig<'many', true> | true, mode: 'many' | 'first');
|
|
712
|
-
prepare(): PreparedQuery<PreparedQueryConfig & {
|
|
713
|
-
type: TResultKind;
|
|
714
|
-
all: TResult;
|
|
715
|
-
get: TResult;
|
|
716
|
-
}>;
|
|
717
|
-
execute(): Result<TResultKind, TResult>;
|
|
554
|
+
type JoinFn<THKT extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelectMode extends SelectMode, TJoinType extends JoinType, TSelection, TNullabilityMap extends Record<string, JoinNullability>> = <TJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL, TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, on: ((aliases: TSelection) => SQL | undefined) | SQL | undefined) => SQLiteSelectKind<THKT, TTableName, TResultType, TRunResult, AppendToResult<TTableName, TSelection, TJoinedName, TJoinedTable extends SQLiteTable ? TJoinedTable['_']['columns'] : TJoinedTable extends Subquery | View ? Assume<TJoinedTable['_']['selectedFields'], SelectedFields> : never, TSelectMode>, TSelectMode extends 'partial' ? TSelectMode : 'multiple', AppendToNullabilityMap<TNullabilityMap, TJoinedName, TJoinType>>;
|
|
555
|
+
type SelectedFieldsFlat = SelectedFieldsFlat$1<SQLiteColumn>;
|
|
556
|
+
type SelectedFields = SelectedFields$1<SQLiteColumn, SQLiteTable>;
|
|
557
|
+
type SelectedFieldsOrdered = SelectedFieldsOrdered$1<SQLiteColumn>;
|
|
558
|
+
interface SQLiteSelectHKTBase {
|
|
559
|
+
tableName: string | undefined;
|
|
560
|
+
resultType: 'sync' | 'async';
|
|
561
|
+
runResult: unknown;
|
|
562
|
+
selection: unknown;
|
|
563
|
+
selectMode: SelectMode;
|
|
564
|
+
nullabilityMap: unknown;
|
|
565
|
+
_type: unknown;
|
|
718
566
|
}
|
|
719
|
-
|
|
567
|
+
type SQLiteSelectKind<T extends SQLiteSelectHKTBase, TTableName extends string | undefined, TResultType extends 'sync' | 'async', TRunResult, TSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability>> = (T & {
|
|
568
|
+
tableName: TTableName;
|
|
569
|
+
resultType: TResultType;
|
|
570
|
+
runResult: TRunResult;
|
|
571
|
+
selection: TSelection;
|
|
572
|
+
selectMode: TSelectMode;
|
|
573
|
+
nullabilityMap: TNullabilityMap;
|
|
574
|
+
})['_type'];
|
|
575
|
+
interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase {
|
|
576
|
+
_type: SQLiteSelectQueryBuilder<this, this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
720
577
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
static readonly [entityKind]: string;
|
|
724
|
-
readonly _: {
|
|
725
|
-
readonly schema: TSchema | undefined;
|
|
726
|
-
readonly tableNamesMap: Record<string, string>;
|
|
727
|
-
};
|
|
728
|
-
query: TFullSchema extends Record<string, never> ? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'> : {
|
|
729
|
-
[K in keyof TSchema]: TResultKind extends 'async' ? AsyncRelationalQueryBuilder<TFullSchema, TSchema, TSchema[K]> : SyncRelationalQueryBuilder<TFullSchema, TSchema, TSchema[K]>;
|
|
730
|
-
};
|
|
731
|
-
constructor(resultKind: TResultKind,
|
|
732
|
-
/** @internal */
|
|
733
|
-
dialect: {
|
|
734
|
-
sync: SQLiteSyncDialect;
|
|
735
|
-
async: SQLiteAsyncDialect;
|
|
736
|
-
}[TResultKind],
|
|
737
|
-
/** @internal */
|
|
738
|
-
session: SQLiteSession<TResultKind, TRunResult, TFullSchema, TSchema>, schema: RelationalSchemaConfig<TSchema> | undefined);
|
|
739
|
-
$with<TAlias extends string>(alias: TAlias): {
|
|
740
|
-
as<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection, unknown> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection, unknown>)): WithSubqueryWithSelection<TSelection, TAlias>;
|
|
741
|
-
};
|
|
742
|
-
with(...queries: WithSubquery[]): {
|
|
743
|
-
select: {
|
|
744
|
-
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
745
|
-
<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult, "db">;
|
|
746
|
-
};
|
|
747
|
-
selectDistinct: {
|
|
748
|
-
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
749
|
-
<TSelection_1 extends SelectedFields>(fields: TSelection_1): SQLiteSelectBuilder<TSelection_1, TResultKind, TRunResult, "db">;
|
|
750
|
-
};
|
|
751
|
-
};
|
|
752
|
-
select(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
753
|
-
select<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
|
|
754
|
-
selectDistinct(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
|
|
755
|
-
selectDistinct<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
|
|
756
|
-
update<TTable extends AnySQLiteTable>(table: TTable): SQLiteUpdateBuilder<TTable, TResultKind, TRunResult>;
|
|
757
|
-
insert<TTable extends AnySQLiteTable>(into: TTable): SQLiteInsertBuilder<TTable, TResultKind, TRunResult>;
|
|
758
|
-
delete<TTable extends AnySQLiteTable>(from: TTable): SQLiteDelete<TTable, TResultKind, TRunResult>;
|
|
759
|
-
run(query: SQLWrapper): Result<TResultKind, TRunResult>;
|
|
760
|
-
all<T = unknown>(query: SQLWrapper): Result<TResultKind, T[]>;
|
|
761
|
-
get<T = unknown>(query: SQLWrapper): Result<TResultKind, T>;
|
|
762
|
-
values<T extends unknown[] = unknown[]>(query: SQLWrapper): Result<TResultKind, T[]>;
|
|
763
|
-
transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
|
|
578
|
+
interface SQLiteSelectHKT extends SQLiteSelectHKTBase {
|
|
579
|
+
_type: SQLiteSelect<this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
|
|
764
580
|
}
|
|
765
581
|
|
|
766
|
-
export {
|
|
582
|
+
export { AnySQLiteSelect as A, BaseSQLiteDatabase as B, SQLiteSelectHKT as C, SQLiteUpdateConfig as D, SQLiteUpdateSetSource as E, SQLiteUpdateBuilder as F, SQLiteUpdate as G, SubqueryWithSelection as H, ViewBuilderCore as I, Join as J, ViewBuilder as K, SQLiteViewConfig as L, ManualViewBuilder as M, SQLiteViewWithSelection as N, sqliteView as O, PreparedQuery as P, QueryBuilder as Q, Result as R, SQLiteSession as S, view as T, ViewBuilderConfig as V, WithSubqueryWithSelection as W, SQLiteSyncDialect as a, SelectedFieldsOrdered as b, SQLiteTransactionConfig as c, SQLiteTransaction as d, PreparedQueryConfig as e, SQLiteAsyncDialect as f, SQLiteView as g, SQLiteViewBase as h, BuildAliasTable as i, SQLiteDialect as j, SQLiteDeleteConfig as k, SQLiteDelete as l, SQLiteInsertConfig as m, SQLiteInsertValue as n, SQLiteInsertBuilder as o, SQLiteInsert as p, SQLiteSelectBuilder as q, SQLiteSelectQueryBuilder as r, SQLiteSelect as s, SQLiteSelectConfig as t, JoinFn as u, SelectedFieldsFlat as v, SelectedFields as w, SQLiteSelectHKTBase as x, SQLiteSelectKind as y, SQLiteSelectQueryBuilderHKT as z };
|