drizzle-orm 0.28.2-8c31aee → 0.28.2-acf0b91

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.

Potentially problematic release.


This version of drizzle-orm might be problematic. Click here for more details.

Files changed (82) hide show
  1. package/alias-3f5ac719.cjs.map +1 -1
  2. package/alias-7164ff43.mjs.map +1 -1
  3. package/aws-data-api/pg/index.d.ts +4 -4
  4. package/aws-data-api/pg/migrator.d.ts +4 -4
  5. package/better-sqlite3/index.cjs +5 -5
  6. package/better-sqlite3/index.cjs.map +1 -1
  7. package/better-sqlite3/index.d.ts +8 -7
  8. package/better-sqlite3/index.mjs +5 -5
  9. package/better-sqlite3/index.mjs.map +1 -1
  10. package/better-sqlite3/migrator.d.ts +5 -5
  11. package/bun-sqlite/index.cjs +5 -5
  12. package/bun-sqlite/index.cjs.map +1 -1
  13. package/bun-sqlite/index.d.ts +8 -7
  14. package/bun-sqlite/index.mjs +5 -5
  15. package/bun-sqlite/index.mjs.map +1 -1
  16. package/bun-sqlite/migrator.d.ts +5 -5
  17. package/{column.d-04875079.d.ts → column.d-13e6ef37.d.ts} +3 -4
  18. package/d1/index.cjs +5 -5
  19. package/d1/index.cjs.map +1 -1
  20. package/d1/index.d.ts +8 -7
  21. package/d1/index.mjs +5 -5
  22. package/d1/index.mjs.map +1 -1
  23. package/d1/migrator.d.ts +5 -5
  24. package/{driver.d-fb641fd3.d.ts → driver.d-1c8fad08.d.ts} +3 -3
  25. package/{driver.d-8b85e3b3.d.ts → driver.d-809deea3.d.ts} +3 -3
  26. package/{driver.d-a60f3981.d.ts → driver.d-844ce4da.d.ts} +3 -3
  27. package/{driver.d-bcbe737b.d.ts → driver.d-a3ee0468.d.ts} +3 -3
  28. package/{driver.d-07cde05a.d.ts → driver.d-b0b4e9a1.d.ts} +3 -3
  29. package/{driver.d-e1832789.d.ts → driver.d-c5a318a3.d.ts} +3 -3
  30. package/index.d.ts +4 -4
  31. package/knex/index.d.ts +1 -1
  32. package/kysely/index.d.ts +1 -1
  33. package/libsql/index.cjs +5 -5
  34. package/libsql/index.cjs.map +1 -1
  35. package/libsql/index.d.ts +8 -7
  36. package/libsql/index.mjs +5 -5
  37. package/libsql/index.mjs.map +1 -1
  38. package/libsql/migrator.d.ts +5 -5
  39. package/mysql-core/index.d.ts +6 -6
  40. package/mysql2/index.d.ts +4 -4
  41. package/mysql2/migrator.d.ts +4 -4
  42. package/neon-http/index.d.ts +4 -4
  43. package/neon-http/migrator.d.ts +4 -4
  44. package/neon-serverless/index.d.ts +4 -4
  45. package/neon-serverless/migrator.d.ts +4 -4
  46. package/node-postgres/index.d.ts +4 -4
  47. package/node-postgres/migrator.d.ts +4 -4
  48. package/package.json +1 -1
  49. package/pg-core/index.d.ts +6 -6
  50. package/planetscale-serverless/index.d.ts +4 -4
  51. package/planetscale-serverless/migrator.d.ts +4 -4
  52. package/postgres-js/index.d.ts +4 -4
  53. package/postgres-js/migrator.d.ts +4 -4
  54. package/{query-promise.d-31db3408.d.ts → query-promise.d-859a27f2.d.ts} +2 -2
  55. package/{select.types.d-b0925107.d.ts → select.types.d-1518a2b5.d.ts} +4 -4
  56. package/{select.types.d-7da7fae0.d.ts → select.types.d-b5ae6f28.d.ts} +73 -71
  57. package/{select.types.d-f5caa4d6.d.ts → select.types.d-c0ef8779.d.ts} +3 -3
  58. package/{select.types.d-3ce070d1.d.ts → select.types.d-f4c3cdca.d.ts} +4 -4
  59. package/{session-16f863cd.mjs → session-0a4e6e7d.mjs} +84 -64
  60. package/session-0a4e6e7d.mjs.map +1 -0
  61. package/{session-e9306785.cjs → session-cb0ac850.cjs} +99 -73
  62. package/session-cb0ac850.cjs.map +1 -0
  63. package/sql-js/index.cjs +7 -7
  64. package/sql-js/index.cjs.map +1 -1
  65. package/sql-js/index.d.ts +9 -8
  66. package/sql-js/index.mjs +7 -7
  67. package/sql-js/index.mjs.map +1 -1
  68. package/sql-js/migrator.d.ts +5 -5
  69. package/sqlite-core/index.cjs +3 -1
  70. package/sqlite-core/index.cjs.map +1 -1
  71. package/sqlite-core/index.d.ts +6 -6
  72. package/sqlite-core/index.mjs +2 -2
  73. package/sqlite-proxy/index.cjs +5 -5
  74. package/sqlite-proxy/index.cjs.map +1 -1
  75. package/sqlite-proxy/index.d.ts +9 -8
  76. package/sqlite-proxy/index.mjs +5 -5
  77. package/sqlite-proxy/index.mjs.map +1 -1
  78. package/sqlite-proxy/migrator.d.ts +5 -5
  79. package/vercel-postgres/index.d.ts +4 -4
  80. package/vercel-postgres/migrator.d.ts +4 -4
  81. package/session-16f863cd.mjs.map +0 -1
  82. package/session-e9306785.cjs.map +0 -1
@@ -1,47 +1,24 @@
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-04875079.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-f5caa4d6.js';
1
+ import { SQLiteTable, entityKind, KnownKeysOnly, ColumnsSelection, Subquery, WithSubquery, DrizzleTypeError, AnySQLiteTable, SQLWrapper, Query, SQL, UpdateSet, SQLiteColumn, InferModel, GetColumnData, Param, Simplify, Placeholder, IndexColumn, ValueOrArray, SQLiteColumnBuilder, BuildColumns, View, Table, SQLiteTableWithColumns, UpdateTableConfig, Assume, SelectedFieldsFlat as SelectedFieldsFlat$1, SelectedFields as SelectedFields$1, SelectedFieldsOrdered as SelectedFieldsOrdered$1 } from './column.d-13e6ef37.js';
2
+ import { AddAliasToSelection, TypedQueryBuilder, SelectResultFields, GetSelectTableName, GetSelectTableSelection, SelectMode, JoinNullability, BuildSubquerySelection, SelectResult, JoinType, MapColumnsToTableAlias, AppendToResult, AppendToNullabilityMap } from './select.types.d-c0ef8779.js';
3
+ import { TablesRelationalConfig, TableRelationalConfig, DBQueryConfig, BuildQueryResult, QueryPromise, ExtractTablesWithRelations, RelationalSchemaConfig, Relation, BuildRelationalQueryResult } from './query-promise.d-859a27f2.js';
3
4
  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-31db3408.js';
5
5
 
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;
14
- static readonly [entityKind]: string;
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>;
18
- }
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;
6
+ type SQLiteRelationalQueryKind<TMode extends 'sync' | 'async', TResult> = TMode extends 'async' ? SQLiteRelationalQuery<TMode, TResult> : SQLiteSyncRelationalQuery<TResult>;
7
+ declare class RelationalQueryBuilder<TMode extends 'sync' | 'async', TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
8
+ protected mode: TMode;
9
+ protected fullSchema: Record<string, unknown>;
10
+ protected schema: TSchema;
11
+ protected tableNamesMap: Record<string, string>;
12
+ protected table: SQLiteTable;
13
+ protected tableConfig: TableRelationalConfig;
14
+ protected dialect: SQLiteDialect;
15
+ protected session: SQLiteSession<'async', unknown, TFullSchema, TSchema>;
27
16
  static readonly [entityKind]: string;
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'];
34
- };
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'];
41
- };
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;
17
+ constructor(mode: TMode, fullSchema: Record<string, unknown>, schema: TSchema, tableNamesMap: Record<string, string>, table: SQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'async', unknown, TFullSchema, TSchema>);
18
+ findMany<TConfig extends DBQueryConfig<'many', true, TSchema, TFields>>(config?: KnownKeysOnly<TConfig, DBQueryConfig<'many', true, TSchema, TFields>>): SQLiteRelationalQueryKind<TMode, BuildQueryResult<TSchema, TFields, TConfig>[]>;
19
+ findFirst<TSelection extends Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>(config?: KnownKeysOnly<TSelection, Omit<DBQueryConfig<'many', true, TSchema, TFields>, 'limit'>>): SQLiteRelationalQueryKind<TMode, BuildQueryResult<TSchema, TFields, TSelection> | undefined>;
43
20
  }
44
- declare class SQLiteRelationalQuery<TResultKind extends 'sync' | 'async', TResult> {
21
+ declare class SQLiteRelationalQuery<TType extends 'sync' | 'async', TResult> extends QueryPromise<TResult> {
45
22
  private fullSchema;
46
23
  private schema;
47
24
  private tableNamesMap;
@@ -53,15 +30,18 @@ declare class SQLiteRelationalQuery<TResultKind extends 'sync' | 'async', TResul
53
30
  private mode;
54
31
  static readonly [entityKind]: string;
55
32
  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');
33
+ constructor(fullSchema: Record<string, unknown>, schema: TablesRelationalConfig, tableNamesMap: Record<string, string>, table: SQLiteTable, tableConfig: TableRelationalConfig, dialect: SQLiteDialect, session: SQLiteSession<'sync' | 'async', unknown, Record<string, unknown>, TablesRelationalConfig>, config: DBQueryConfig<'many', true> | true, mode: 'many' | 'first');
57
34
  prepare(): PreparedQuery<PreparedQueryConfig & {
58
- type: TResultKind;
35
+ type: TType;
59
36
  all: TResult;
60
37
  get: TResult;
38
+ execute: TResult;
61
39
  }>;
62
- execute(): Result<TResultKind, TResult>;
40
+ execute(): Promise<TResult>;
63
41
  }
64
- interface SQLiteAsyncRelationalQuery<TResult> extends SQLiteRelationalQuery<'async', TResult>, QueryPromise<TResult> {
42
+ declare class SQLiteSyncRelationalQuery<TResult> extends SQLiteRelationalQuery<'sync', TResult> {
43
+ static readonly [entityKind]: string;
44
+ sync(): TResult;
65
45
  }
66
46
 
67
47
  type SubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = Subquery<TAlias, AddAliasToSelection<TSelection, TAlias, 'sqlite'>> & AddAliasToSelection<TSelection, TAlias, 'sqlite'>;
@@ -74,7 +54,7 @@ declare class BaseSQLiteDatabase<TResultKind extends 'sync' | 'async', TRunResul
74
54
  readonly tableNamesMap: Record<string, string>;
75
55
  };
76
56
  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]>;
57
+ [K in keyof TSchema]: RelationalQueryBuilder<TResultKind, TFullSchema, TSchema, TSchema[K]>;
78
58
  };
79
59
  constructor(resultKind: TResultKind,
80
60
  /** @internal */
@@ -114,20 +94,34 @@ declare class BaseSQLiteDatabase<TResultKind extends 'sync' | 'async', TRunResul
114
94
  interface PreparedQueryConfig {
115
95
  type: 'sync' | 'async';
116
96
  run: unknown;
117
- all: unknown[];
97
+ all: unknown;
118
98
  get: unknown;
119
- values: unknown[][];
99
+ values: unknown;
100
+ execute: unknown;
120
101
  }
102
+ declare class ExecuteResultSync<T> extends QueryPromise<T> {
103
+ private resultCb;
104
+ static readonly [entityKind]: string;
105
+ constructor(resultCb: () => T);
106
+ execute(): Promise<T>;
107
+ sync(): T;
108
+ }
109
+ type ExecuteResult<TType extends 'sync' | 'async', TResult> = TType extends 'async' ? Promise<TResult> : ExecuteResultSync<TResult>;
121
110
  declare abstract class PreparedQuery<T extends PreparedQueryConfig> {
111
+ private mode;
112
+ private executeMethod;
122
113
  static readonly [entityKind]: string;
114
+ constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod);
123
115
  abstract run(placeholderValues?: Record<string, unknown>): Result<T['type'], T['run']>;
124
116
  abstract all(placeholderValues?: Record<string, unknown>): Result<T['type'], T['all']>;
125
117
  abstract get(placeholderValues?: Record<string, unknown>): Result<T['type'], T['get']>;
126
118
  abstract values(placeholderValues?: Record<string, unknown>): Result<T['type'], T['values']>;
119
+ execute(placeholderValues?: Record<string, unknown>): ExecuteResult<T['type'], T['execute']>;
127
120
  }
128
121
  interface SQLiteTransactionConfig {
129
122
  behavior?: 'deferred' | 'immediate' | 'exclusive';
130
123
  }
124
+ type SQLiteExecuteMethod = 'run' | 'all' | 'get';
131
125
  declare abstract class SQLiteSession<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> {
132
126
  static readonly [entityKind]: string;
133
127
  constructor(
@@ -136,10 +130,10 @@ declare abstract class SQLiteSession<TResultKind extends 'sync' | 'async', TRunR
136
130
  sync: SQLiteSyncDialect;
137
131
  async: SQLiteAsyncDialect;
138
132
  }[TResultKind]);
139
- abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown): PreparedQuery<PreparedQueryConfig & {
133
+ abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown): PreparedQuery<PreparedQueryConfig & {
140
134
  type: TResultKind;
141
135
  }>;
142
- prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined): PreparedQuery<PreparedQueryConfig & {
136
+ prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod): PreparedQuery<PreparedQueryConfig & {
143
137
  type: TResultKind;
144
138
  }>;
145
139
  abstract transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
@@ -232,7 +226,7 @@ interface SQLiteDeleteConfig {
232
226
  }
233
227
  interface SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper {
234
228
  }
235
- declare class SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> implements SQLWrapper {
229
+ declare class SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements SQLWrapper {
236
230
  private table;
237
231
  private session;
238
232
  private dialect;
@@ -240,20 +234,22 @@ declare class SQLiteDelete<TTable extends SQLiteTable, TResultType extends 'sync
240
234
  private config;
241
235
  constructor(table: TTable, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
242
236
  where(where: SQL | undefined): Omit<this, 'where'>;
243
- returning(): Omit<SQLiteDelete<TTable, TResultType, TRunResult, InferModel<TTable>>, 'where' | 'returning'>;
244
- returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): Omit<SQLiteDelete<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>, 'where' | 'returning'>;
237
+ returning(): SQLiteDelete<TTable, TResultType, TRunResult, InferModel<TTable>>;
238
+ returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): SQLiteDelete<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>;
245
239
  toSQL(): Omit<Query, 'typings'>;
246
240
  prepare(isOneTimeQuery?: boolean): PreparedQuery<{
247
241
  type: TResultType;
248
242
  run: TRunResult;
249
- all: TReturning extends undefined ? never : TReturning[];
250
- get: TReturning extends undefined ? never : TReturning | undefined;
251
- values: TReturning extends undefined ? never : any[][];
243
+ all: TReturning extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : TReturning[];
244
+ get: TReturning extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : TReturning | undefined;
245
+ values: TReturning extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
246
+ execute: TReturning extends undefined ? TRunResult : TReturning[];
252
247
  }>;
253
248
  run: ReturnType<this['prepare']>['run'];
254
249
  all: ReturnType<this['prepare']>['all'];
255
250
  get: ReturnType<this['prepare']>['get'];
256
251
  values: ReturnType<this['prepare']>['values'];
252
+ execute(placeholderValues?: Record<string, unknown>): Promise<TReturning extends undefined ? TRunResult : TReturning[]>;
257
253
  }
258
254
 
259
255
  interface SQLiteUpdateConfig {
@@ -276,9 +272,9 @@ declare class SQLiteUpdateBuilder<TTable extends AnySQLiteTable, TResultType ext
276
272
  constructor(table: TTable, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
277
273
  set(values: SQLiteUpdateSetSource<TTable>): SQLiteUpdate<TTable, TResultType, TRunResult>;
278
274
  }
279
- interface SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper {
275
+ interface SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper, QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> {
280
276
  }
281
- declare class SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> implements SQLWrapper {
277
+ declare class SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements SQLWrapper {
282
278
  private session;
283
279
  private dialect;
284
280
  static readonly [entityKind]: string;
@@ -288,8 +284,8 @@ declare class SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 's
288
284
  private config;
289
285
  constructor(table: TTable, set: UpdateSet, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
290
286
  where(where: SQL | undefined): Omit<this, 'where'>;
291
- returning(): Omit<SQLiteUpdate<TTable, TResultType, TRunResult, InferModel<TTable>>, 'where' | 'returning'>;
292
- returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): Omit<SQLiteUpdate<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>, 'where' | 'returning'>;
287
+ returning(): SQLiteUpdate<TTable, TResultType, TRunResult, InferModel<TTable>>;
288
+ returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): SQLiteUpdate<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>;
293
289
  toSQL(): {
294
290
  sql: Query['sql'];
295
291
  params: Query['params'];
@@ -297,14 +293,16 @@ declare class SQLiteUpdate<TTable extends AnySQLiteTable, TResultType extends 's
297
293
  prepare(isOneTimeQuery?: boolean): PreparedQuery<{
298
294
  type: TResultType;
299
295
  run: TRunResult;
300
- all: TReturning extends undefined ? never : TReturning[];
301
- get: TReturning extends undefined ? never : TReturning;
302
- values: TReturning extends undefined ? never : any[][];
296
+ all: TReturning extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : TReturning[];
297
+ get: TReturning extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : TReturning;
298
+ values: TReturning extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
299
+ execute: TReturning extends undefined ? TRunResult : TReturning[];
303
300
  }>;
304
301
  run: ReturnType<this['prepare']>['run'];
305
302
  all: ReturnType<this['prepare']>['all'];
306
303
  get: ReturnType<this['prepare']>['get'];
307
304
  values: ReturnType<this['prepare']>['values'];
305
+ execute(): Promise<TReturning extends undefined ? TRunResult : TReturning[]>;
308
306
  }
309
307
 
310
308
  interface SQLiteInsertConfig<TTable extends AnySQLiteTable = AnySQLiteTable> {
@@ -325,9 +323,9 @@ declare class SQLiteInsertBuilder<TTable extends AnySQLiteTable, TResultType ext
325
323
  values(value: SQLiteInsertValue<TTable>): SQLiteInsert<TTable, TResultType, TRunResult>;
326
324
  values(values: SQLiteInsertValue<TTable>[]): SQLiteInsert<TTable, TResultType, TRunResult>;
327
325
  }
328
- interface SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper {
326
+ interface SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends SQLWrapper, QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> {
329
327
  }
330
- declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> implements SQLWrapper {
328
+ declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 'sync' | 'async', TRunResult, TReturning = undefined> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements SQLWrapper {
331
329
  private session;
332
330
  private dialect;
333
331
  static readonly [entityKind]: string;
@@ -339,8 +337,8 @@ declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 's
339
337
  };
340
338
  private config;
341
339
  constructor(table: TTable, values: SQLiteInsertConfig['values'], session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect);
342
- returning(): Omit<SQLiteInsert<TTable, TResultType, TRunResult, InferModel<TTable>>, 'returning' | `onConflict${string}`>;
343
- returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): Omit<SQLiteInsert<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>, 'returning' | `onConflict${string}`>;
340
+ returning(): SQLiteInsert<TTable, TResultType, TRunResult, InferModel<TTable>>;
341
+ returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): SQLiteInsert<TTable, TResultType, TRunResult, SelectResultFields<TSelectedFields>>;
344
342
  onConflictDoNothing(config?: {
345
343
  target?: IndexColumn | IndexColumn[];
346
344
  where?: SQL;
@@ -357,14 +355,16 @@ declare class SQLiteInsert<TTable extends AnySQLiteTable, TResultType extends 's
357
355
  prepare(isOneTimeQuery?: boolean): PreparedQuery<{
358
356
  type: TResultType;
359
357
  run: TRunResult;
360
- all: TReturning extends undefined ? never : TReturning[];
361
- get: TReturning extends undefined ? never : TReturning;
362
- values: TReturning extends undefined ? never : any[][];
358
+ all: TReturning extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : TReturning[];
359
+ get: TReturning extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : TReturning;
360
+ values: TReturning extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
361
+ execute: TReturning extends undefined ? TRunResult : TReturning[];
363
362
  }>;
364
363
  run: ReturnType<this['prepare']>['run'];
365
364
  all: ReturnType<this['prepare']>['all'];
366
365
  get: ReturnType<this['prepare']>['get'];
367
366
  values: ReturnType<this['prepare']>['values'];
367
+ execute(): Promise<TReturning extends undefined ? TRunResult : TReturning[]>;
368
368
  }
369
369
 
370
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>;
@@ -427,7 +427,7 @@ declare abstract class SQLiteSelectQueryBuilder<THKT extends SQLiteSelectHKTBase
427
427
  as<TAlias extends string>(alias: TAlias): SubqueryWithSelection<BuildSubquerySelection<TSelection, TNullabilityMap>, TAlias>;
428
428
  getSelectedFields(): BuildSubquerySelection<TSelection, TNullabilityMap>;
429
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> {
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>, QueryPromise<SelectResult<TSelection, TSelectMode, TNullabilityMap>[]> {
431
431
  }
432
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
433
  static readonly [entityKind]: string;
@@ -437,11 +437,13 @@ declare class SQLiteSelect<TTableName extends string | undefined, TResultType ex
437
437
  all: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
438
438
  get: SelectResult<TSelection, TSelectMode, TNullabilityMap> | undefined;
439
439
  values: any[][];
440
+ execute: SelectResult<TSelection, TSelectMode, TNullabilityMap>[];
440
441
  }>;
441
442
  run: ReturnType<this['prepare']>['run'];
442
443
  all: ReturnType<this['prepare']>['all'];
443
444
  get: ReturnType<this['prepare']>['get'];
444
445
  values: ReturnType<this['prepare']>['values'];
446
+ execute(): Promise<SelectResult<TSelection, TSelectMode, TNullabilityMap>[]>;
445
447
  }
446
448
 
447
449
  declare class QueryBuilder {
@@ -579,4 +581,4 @@ interface SQLiteSelectHKT extends SQLiteSelectHKTBase {
579
581
  _type: SQLiteSelect<this['tableName'], this['resultType'], this['runResult'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
580
582
  }
581
583
 
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 };
584
+ export { AnySQLiteSelect, BaseSQLiteDatabase, BuildAliasTable, ExecuteResult, ExecuteResultSync, Join, JoinFn, ManualViewBuilder, PreparedQuery, PreparedQueryConfig, QueryBuilder, Result, SQLiteAsyncDialect, SQLiteDelete, SQLiteDeleteConfig, SQLiteDialect, SQLiteExecuteMethod, SQLiteInsert, SQLiteInsertBuilder, SQLiteInsertConfig, SQLiteInsertValue, SQLiteSelect, SQLiteSelectBuilder, SQLiteSelectConfig, SQLiteSelectHKT, SQLiteSelectHKTBase, SQLiteSelectKind, SQLiteSelectQueryBuilder, SQLiteSelectQueryBuilderHKT, SQLiteSession, SQLiteSyncDialect, SQLiteTransaction, SQLiteTransactionConfig, SQLiteUpdate, SQLiteUpdateBuilder, SQLiteUpdateConfig, SQLiteUpdateSetSource, SQLiteView, SQLiteViewBase, SQLiteViewConfig, SQLiteViewWithSelection, SelectedFields, SelectedFieldsFlat, SelectedFieldsOrdered, SubqueryWithSelection, ViewBuilder, ViewBuilderConfig, ViewBuilderCore, WithSubqueryWithSelection, sqliteView, view };
@@ -1,4 +1,4 @@
1
- import { X as SQLWrapper, e as entityKind, a as SQL, an as AnyTable, C as Column, A as AnyColumn, aJ as ColumnsSelection, h as Dialect, p as ChangeColumnTableName, av as Assume, S as Simplify, aH as IsAny, E as SelectedFields, T as Table, ax as DrizzleTypeError, ah as Subquery, V as View, aw as Equal, G as GetColumnData, U as UpdateColConfig } from './column.d-04875079.js';
1
+ import { SQLWrapper, entityKind, SQL, AnyTable, Column, AnyColumn, ColumnsSelection, Dialect, ChangeColumnTableName, Assume, Simplify, IsAny, SelectedFields, Table, DrizzleTypeError, Subquery, View, Equal, GetColumnData, UpdateColConfig } from './column.d-13e6ef37.js';
2
2
 
3
3
  declare abstract class TypedQueryBuilder<TSelection, TResult = unknown> implements SQLWrapper {
4
4
  static readonly [entityKind]: string;
@@ -52,9 +52,9 @@ type AppendToNullabilityMap<TJoinsNotNull extends Record<string, JoinNullability
52
52
  type TableLike = Table | Subquery | View | SQL;
53
53
  type GetSelectTableName<TTable extends TableLike> = TTable extends Table ? TTable['_']['name'] : TTable extends Subquery ? TTable['_']['alias'] : TTable extends View ? TTable['_']['name'] : TTable extends SQL ? undefined : never;
54
54
  type GetSelectTableSelection<TTable extends TableLike> = TTable extends Table ? TTable['_']['columns'] : TTable extends Subquery | View ? Assume<TTable['_']['selectedFields'], ColumnsSelection> : TTable extends SQL ? {} : never;
55
- type SelectResultField<T, TDeep extends boolean = true> = T extends DrizzleTypeError<any> ? T : T extends Table ? Equal<TDeep, true> extends true ? SelectResultField<T['_']['columns'], false> : never : T extends Column ? GetColumnData<T> : T extends SQL | SQL.Aliased ? T['_']['type'] : T extends Record<string, any> ? SelectResultFields<T, true> : never;
55
+ type SelectResultField<T, TDeep extends boolean = true> = T extends DrizzleTypeError<any> ? T : T extends Table ? Equal<TDeep, true> extends true ? SelectResultField<T['_']['columns'], false> : never : T extends Column<any> ? GetColumnData<T> : T extends SQL | SQL.Aliased ? T['_']['type'] : T extends Record<string, any> ? SelectResultFields<T, true> : never;
56
56
  type SelectResultFields<TSelectedFields, TDeep extends boolean = true> = {
57
57
  [Key in keyof TSelectedFields & string]: SelectResultField<TSelectedFields[Key], TDeep>;
58
58
  } & {};
59
59
 
60
- export { AddAliasToSelection as A, BuildSubquerySelection as B, GetSelectTableName as G, JoinNullability as J, MapColumnsToTableAlias as M, SelectMode as S, TypedQueryBuilder as T, GetSelectTableSelection as a, SelectResult as b, JoinType as c, AppendToResult as d, AppendToNullabilityMap as e, SelectResultFields as f };
60
+ export { AddAliasToSelection, AppendToNullabilityMap, AppendToResult, BuildSubquerySelection, GetSelectTableName, GetSelectTableSelection, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode, SelectResult, SelectResultFields, TypedQueryBuilder };
@@ -1,6 +1,6 @@
1
- import { e as entityKind, bm as AnyPgTable, aF as KnownKeysOnly, Q as Query, aJ as ColumnsSelection, ah as Subquery, ai as WithSubquery, ax as DrizzleTypeError, bn as AnyPgColumn, X as SQLWrapper, a as SQL, aq as UpdateSet, a3 as DriverValueEncoder, W as QueryTypingsValue, bo as PgColumn, I as InferModel, G as GetColumnData, a9 as Param, ad as Placeholder, bp as IndexColumn, ay as ValueOrArray, bq as PgColumnBuilder, o as BuildColumns, br as AnyPgColumnBuilder, V as View, bs as PgTable, T as Table, bt as PgTableWithColumns, al as UpdateTableConfig, av as Assume, y as SelectedFieldsFlat$1, E as SelectedFields$1, F as SelectedFieldsOrdered$1 } from './column.d-04875079.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-f5caa4d6.js';
3
- 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-31db3408.js';
1
+ import { entityKind, AnyPgTable, KnownKeysOnly, Query, ColumnsSelection, Subquery, WithSubquery, DrizzleTypeError, AnyPgColumn, SQLWrapper, SQL, UpdateSet, DriverValueEncoder, QueryTypingsValue, PgColumn, InferModel, GetColumnData, Param, Placeholder, IndexColumn$1 as IndexColumn, ValueOrArray, PgColumnBuilder, BuildColumns, AnyPgColumnBuilder, View, PgTable, Table, PgTableWithColumns, UpdateTableConfig, Assume, SelectedFieldsFlat as SelectedFieldsFlat$1, SelectedFields as SelectedFields$1, SelectedFieldsOrdered as SelectedFieldsOrdered$1 } from './column.d-13e6ef37.js';
2
+ import { AddAliasToSelection, TypedQueryBuilder, SelectResultFields, GetSelectTableName, GetSelectTableSelection, SelectMode, JoinNullability, BuildSubquerySelection, SelectResult, JoinType, MapColumnsToTableAlias, AppendToResult, AppendToNullabilityMap } from './select.types.d-c0ef8779.js';
3
+ import { TablesRelationalConfig, TableRelationalConfig, DBQueryConfig, BuildQueryResult, QueryPromise, ExtractTablesWithRelations, RelationalSchemaConfig, Relation, BuildRelationalQueryResult } from './query-promise.d-859a27f2.js';
4
4
  import { MigrationMeta } from './migrator.js';
5
5
 
6
6
  declare class RelationalQueryBuilder<TSchema extends TablesRelationalConfig, TFields extends TableRelationalConfig> {
@@ -740,4 +740,4 @@ interface PgSelectHKT extends PgSelectHKTBase {
740
740
  _type: PgSelect<this['tableName'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['nullabilityMap'], Record<string, JoinNullability>>>;
741
741
  }
742
742
 
743
- export { PgViewConfig as $, AnyPgSelect as A, BuildAliasTable as B, PgUpdateConfig as C, PgUpdateSetSource as D, PgUpdateBuilder as E, PgUpdate as F, PreparedQueryConfig as G, PreparedQuery as H, PgTransactionConfig as I, Join as J, PgSession as K, LockStrength as L, PgTransaction as M, QueryResultHKT as N, QueryResultKind as O, PgViewBase as P, QueryBuilder as Q, SubqueryWithSelection as R, SelectedFieldsFlat as S, DefaultViewBuilderCore as T, ViewBuilder as U, ViewWithConfig as V, WithSubqueryWithSelection as W, ManualViewBuilder as X, MaterializedViewBuilderCore as Y, MaterializedViewBuilder as Z, ManualMaterializedViewBuilder as _, pgMaterializedView as a, PgViewWithSelection as a0, PgMaterializedViewConfig as a1, PgMaterializedViewWithSelection as a2, PgView as b, PgMaterializedView as c, PgMaterializedViewWithConfig as d, PgDatabase as e, PgDialect as f, PgDeleteConfig as g, PgDelete as h, PgInsertConfig as i, PgInsertValue as j, PgInsertBuilder as k, PgInsert as l, PgRefreshMaterializedView as m, PgSelectBuilder as n, PgSelectQueryBuilder as o, pgView as p, PgSelect as q, PgSelectConfig as r, JoinFn as s, SelectedFields as t, SelectedFieldsOrdered as u, LockConfig as v, PgSelectHKTBase as w, PgSelectKind as x, PgSelectQueryBuilderHKT as y, PgSelectHKT as z };
743
+ export { AnyPgSelect, BuildAliasTable, DefaultViewBuilderCore, Join, JoinFn, LockConfig, LockStrength, ManualMaterializedViewBuilder, ManualViewBuilder, MaterializedViewBuilder, MaterializedViewBuilderCore, PgDatabase, PgDelete, PgDeleteConfig, PgDialect, PgInsert, PgInsertBuilder, PgInsertConfig, PgInsertValue, PgMaterializedView, PgMaterializedViewConfig, PgMaterializedViewWithConfig, PgMaterializedViewWithSelection, PgRefreshMaterializedView, PgSelect, PgSelectBuilder, PgSelectConfig, PgSelectHKT, PgSelectHKTBase, PgSelectKind, PgSelectQueryBuilder, PgSelectQueryBuilderHKT, PgSession, PgTransaction, PgTransactionConfig, PgUpdate, PgUpdateBuilder, PgUpdateConfig, PgUpdateSetSource, PgView, PgViewBase, PgViewConfig, PgViewWithSelection, PreparedQuery, PreparedQueryConfig, QueryBuilder, QueryResultHKT, QueryResultKind, SelectedFields, SelectedFieldsFlat, SelectedFieldsOrdered, SubqueryWithSelection, ViewBuilder, ViewWithConfig, WithSubqueryWithSelection, pgMaterializedView, pgView };