orchid-orm 1.72.7 → 1.72.8

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/dist/bun.d.ts CHANGED
@@ -1,17 +1,24 @@
1
1
  import * as _$pqb_internal0 from "pqb/internal";
2
- import { DbSharedOptions } from "pqb/internal";
2
+ import { DbSharedOptions, EmptyObject } from "pqb/internal";
3
3
  import * as _$pqb_bun0 from "pqb/bun";
4
4
  import { BunAdapterOptions, bunSchemaConfig } from "pqb/bun";
5
- import { OrchidORM, OrchidORMTables, OrchidOrmParam, TableClasses } from "orchid-orm";
6
- interface BunOrchidORMOptions extends BunAdapterOptions, DbSharedOptions {}
5
+ import { OrchidORM, OrchidORMBundle, OrchidOrmParam, TableClasses } from "orchid-orm";
6
+ interface BunOrchidORMOptions extends BunAdapterOptions, DbSharedOptions {
7
+ views?: TableClasses;
8
+ }
7
9
  declare const Adapter: _$pqb_internal0.DriverAdapter;
8
10
  declare const createDb: <SchemaConfig extends _$pqb_internal0.ColumnSchemaConfig = _$pqb_internal0.DefaultSchemaConfig, ColumnTypes = _$pqb_internal0.DefaultColumnTypes<SchemaConfig>>({
9
11
  log,
10
12
  ...options
11
13
  }: _$pqb_bun0.CreateBunDbOptions<SchemaConfig, ColumnTypes>) => _$pqb_internal0.DbResult<ColumnTypes>;
12
- declare const makeOrchidOrmDb: <T extends TableClasses>(orm: OrchidORMTables<T>, {
14
+ declare const makeOrchidOrmDb: <T extends TableClasses, V extends TableClasses = EmptyObject>(orm: OrchidORMBundle<T, V>, {
13
15
  log,
14
16
  ...options
15
- }: OrchidOrmParam<BunOrchidORMOptions>) => OrchidORM<T>;
16
- declare const orchidORM: <T extends TableClasses>(options: OrchidOrmParam<BunOrchidORMOptions>, tables: T) => OrchidORM<T>;
17
+ }: OrchidOrmParam<BunOrchidORMOptions>) => OrchidORM<T, V>;
18
+ declare const orchidORM: <T extends TableClasses, V extends TableClasses = EmptyObject>({
19
+ views,
20
+ ...options
21
+ }: OrchidOrmParam<BunOrchidORMOptions & {
22
+ views?: V;
23
+ }>, tables: T) => OrchidORM<T, V>;
17
24
  export { Adapter, BunOrchidORMOptions, bunSchemaConfig, createDb, makeOrchidOrmDb, orchidORM };
package/dist/bun.js CHANGED
@@ -14,8 +14,11 @@ const makeOrchidOrmDb = (orm, { log, ...options }) => {
14
14
  })
15
15
  });
16
16
  };
17
- const orchidORM = (options, tables) => {
18
- return makeOrchidOrmDb((0, orchid_orm.bundleOrchidORMTables)(tables), options);
17
+ const orchidORM = ({ views, ...options }, tables) => {
18
+ return makeOrchidOrmDb((0, orchid_orm.bundleOrchidORM)({
19
+ tables,
20
+ views
21
+ }), options);
19
22
  };
20
23
  exports.Adapter = Adapter;
21
24
  Object.defineProperty(exports, "bunSchemaConfig", {
package/dist/bun.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bun.js","names":["BunAdapter","cdb","AdapterClass"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import {\n TableClasses,\n OrchidORM,\n OrchidORMTables,\n OrchidOrmParam,\n bundleOrchidORMTables,\n makeOrchidOrmDbWithAdapter,\n} from 'orchid-orm';\nimport { BunAdapter, BunAdapterOptions, createDb as cdb } from 'pqb/bun';\nimport { DbSharedOptions, AdapterClass } from 'pqb/internal';\nexport { bunSchemaConfig } from 'pqb/bun';\n\nexport interface BunOrchidORMOptions\n extends BunAdapterOptions, DbSharedOptions {}\n\nexport const Adapter = BunAdapter;\n\nexport const createDb = cdb;\n\nexport const makeOrchidOrmDb = <T extends TableClasses>(\n orm: OrchidORMTables<T>,\n { log, ...options }: OrchidOrmParam<BunOrchidORMOptions>,\n): OrchidORM<T> => {\n return makeOrchidOrmDbWithAdapter(orm, {\n ...options,\n log,\n adapter: new AdapterClass({\n driverAdapter: BunAdapter,\n config: options,\n }),\n });\n};\n\nexport const orchidORM = <T extends TableClasses>(\n options: OrchidOrmParam<BunOrchidORMOptions>,\n tables: T,\n): OrchidORM<T> => {\n const orm = bundleOrchidORMTables(tables);\n return makeOrchidOrmDb(orm, options);\n};\n"],"mappings":";;;;AAeA,MAAa,UAAUA,QAAAA;AAEvB,MAAa,WAAWC,QAAAA;AAExB,MAAa,mBACX,KACA,EAAE,KAAK,GAAG,cACO;AACjB,SAAA,GAAA,WAAA,4BAAkC,KAAK;EACrC,GAAG;EACH;EACA,SAAS,IAAIC,aAAAA,aAAa;GACxB,eAAeF,QAAAA;GACf,QAAQ;GACT,CAAC;EACH,CAAC;;AAGJ,MAAa,aACX,SACA,WACiB;AAEjB,QAAO,iBAAA,GAAA,WAAA,uBAD2B,OAAO,EACb,QAAQ"}
1
+ {"version":3,"file":"bun.js","names":["BunAdapter","cdb","AdapterClass"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import {\n TableClasses,\n OrchidORM,\n OrchidORMBundle,\n OrchidOrmParam,\n bundleOrchidORM,\n makeOrchidOrmDbWithAdapter,\n} from 'orchid-orm';\nimport { BunAdapter, BunAdapterOptions, createDb as cdb } from 'pqb/bun';\nimport { DbSharedOptions, AdapterClass, EmptyObject } from 'pqb/internal';\nexport { bunSchemaConfig } from 'pqb/bun';\n\nexport interface BunOrchidORMOptions\n extends BunAdapterOptions, DbSharedOptions {\n views?: TableClasses;\n}\n\nexport const Adapter = BunAdapter;\n\nexport const createDb = cdb;\n\nexport const makeOrchidOrmDb = <\n T extends TableClasses,\n V extends TableClasses = EmptyObject,\n>(\n orm: OrchidORMBundle<T, V>,\n { log, ...options }: OrchidOrmParam<BunOrchidORMOptions>,\n): OrchidORM<T, V> => {\n return makeOrchidOrmDbWithAdapter(orm, {\n ...options,\n log,\n adapter: new AdapterClass({\n driverAdapter: BunAdapter,\n config: options,\n }),\n });\n};\n\nexport const orchidORM = <\n T extends TableClasses,\n V extends TableClasses = EmptyObject,\n>(\n { views, ...options }: OrchidOrmParam<BunOrchidORMOptions & { views?: V }>,\n tables: T,\n): OrchidORM<T, V> => {\n const orm = bundleOrchidORM({ tables, views });\n return makeOrchidOrmDb(orm, options);\n};\n"],"mappings":";;;;AAiBA,MAAa,UAAUA,QAAAA;AAEvB,MAAa,WAAWC,QAAAA;AAExB,MAAa,mBAIX,KACA,EAAE,KAAK,GAAG,cACU;AACpB,SAAA,GAAA,WAAA,4BAAkC,KAAK;EACrC,GAAG;EACH;EACA,SAAS,IAAIC,aAAAA,aAAa;GACxB,eAAeF,QAAAA;GACf,QAAQ;GACT,CAAC;EACH,CAAC;;AAGJ,MAAa,aAIX,EAAE,OAAO,GAAG,WACZ,WACoB;AAEpB,QAAO,iBAAA,GAAA,WAAA,iBADqB;EAAE;EAAQ;EAAO,CAAC,EAClB,QAAQ"}
package/dist/bun.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bundleOrchidORMTables, makeOrchidOrmDbWithAdapter } from "orchid-orm";
1
+ import { bundleOrchidORM, makeOrchidOrmDbWithAdapter } from "orchid-orm";
2
2
  import { BunAdapter, bunSchemaConfig, createDb as createDb$1 } from "pqb/bun";
3
3
  import { AdapterClass } from "pqb/internal";
4
4
  const Adapter = BunAdapter;
@@ -13,8 +13,11 @@ const makeOrchidOrmDb = (orm, { log, ...options }) => {
13
13
  })
14
14
  });
15
15
  };
16
- const orchidORM = (options, tables) => {
17
- return makeOrchidOrmDb(bundleOrchidORMTables(tables), options);
16
+ const orchidORM = ({ views, ...options }, tables) => {
17
+ return makeOrchidOrmDb(bundleOrchidORM({
18
+ tables,
19
+ views
20
+ }), options);
18
21
  };
19
22
  export { Adapter, bunSchemaConfig, createDb, makeOrchidOrmDb, orchidORM };
20
23
 
package/dist/bun.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bun.mjs","names":["cdb"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import {\n TableClasses,\n OrchidORM,\n OrchidORMTables,\n OrchidOrmParam,\n bundleOrchidORMTables,\n makeOrchidOrmDbWithAdapter,\n} from 'orchid-orm';\nimport { BunAdapter, BunAdapterOptions, createDb as cdb } from 'pqb/bun';\nimport { DbSharedOptions, AdapterClass } from 'pqb/internal';\nexport { bunSchemaConfig } from 'pqb/bun';\n\nexport interface BunOrchidORMOptions\n extends BunAdapterOptions, DbSharedOptions {}\n\nexport const Adapter = BunAdapter;\n\nexport const createDb = cdb;\n\nexport const makeOrchidOrmDb = <T extends TableClasses>(\n orm: OrchidORMTables<T>,\n { log, ...options }: OrchidOrmParam<BunOrchidORMOptions>,\n): OrchidORM<T> => {\n return makeOrchidOrmDbWithAdapter(orm, {\n ...options,\n log,\n adapter: new AdapterClass({\n driverAdapter: BunAdapter,\n config: options,\n }),\n });\n};\n\nexport const orchidORM = <T extends TableClasses>(\n options: OrchidOrmParam<BunOrchidORMOptions>,\n tables: T,\n): OrchidORM<T> => {\n const orm = bundleOrchidORMTables(tables);\n return makeOrchidOrmDb(orm, options);\n};\n"],"mappings":";;;AAeA,MAAa,UAAU;AAEvB,MAAa,WAAWA;AAExB,MAAa,mBACX,KACA,EAAE,KAAK,GAAG,cACO;AACjB,QAAO,2BAA2B,KAAK;EACrC,GAAG;EACH;EACA,SAAS,IAAI,aAAa;GACxB,eAAe;GACf,QAAQ;GACT,CAAC;EACH,CAAC;;AAGJ,MAAa,aACX,SACA,WACiB;AAEjB,QAAO,gBADK,sBAAsB,OAAO,EACb,QAAQ"}
1
+ {"version":3,"file":"bun.mjs","names":["cdb"],"sources":["../src/adapters/bun.ts"],"sourcesContent":["import {\n TableClasses,\n OrchidORM,\n OrchidORMBundle,\n OrchidOrmParam,\n bundleOrchidORM,\n makeOrchidOrmDbWithAdapter,\n} from 'orchid-orm';\nimport { BunAdapter, BunAdapterOptions, createDb as cdb } from 'pqb/bun';\nimport { DbSharedOptions, AdapterClass, EmptyObject } from 'pqb/internal';\nexport { bunSchemaConfig } from 'pqb/bun';\n\nexport interface BunOrchidORMOptions\n extends BunAdapterOptions, DbSharedOptions {\n views?: TableClasses;\n}\n\nexport const Adapter = BunAdapter;\n\nexport const createDb = cdb;\n\nexport const makeOrchidOrmDb = <\n T extends TableClasses,\n V extends TableClasses = EmptyObject,\n>(\n orm: OrchidORMBundle<T, V>,\n { log, ...options }: OrchidOrmParam<BunOrchidORMOptions>,\n): OrchidORM<T, V> => {\n return makeOrchidOrmDbWithAdapter(orm, {\n ...options,\n log,\n adapter: new AdapterClass({\n driverAdapter: BunAdapter,\n config: options,\n }),\n });\n};\n\nexport const orchidORM = <\n T extends TableClasses,\n V extends TableClasses = EmptyObject,\n>(\n { views, ...options }: OrchidOrmParam<BunOrchidORMOptions & { views?: V }>,\n tables: T,\n): OrchidORM<T, V> => {\n const orm = bundleOrchidORM({ tables, views });\n return makeOrchidOrmDb(orm, options);\n};\n"],"mappings":";;;AAiBA,MAAa,UAAU;AAEvB,MAAa,WAAWA;AAExB,MAAa,mBAIX,KACA,EAAE,KAAK,GAAG,cACU;AACpB,QAAO,2BAA2B,KAAK;EACrC,GAAG;EACH;EACA,SAAS,IAAI,aAAa;GACxB,eAAe;GACf,QAAQ;GACT,CAAC;EACH,CAAC;;AAGJ,MAAa,aAIX,EAAE,OAAO,GAAG,WACZ,WACoB;AAEpB,QAAO,gBADK,gBAAgB;EAAE;EAAQ;EAAO,CAAC,EAClB,QAAQ"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Adapter, AfterCommitStandaloneHook, AfterHook, Column, ColumnSchemaConfig, ColumnsShape, ComputedColumnsFromOptions, ComputedOptionsConfig, ComputedOptionsFactory, CreateData, CreateManyMethodsNames, CreateMethodsNames, CreateSelf, DbSharedOptions, DbSqlMethod, DbTableOptionScopes, DefaultColumnTypes, DefaultSchemaConfig, DeleteMethodsNames, EmptyObject, FromArg, FromResult, Grant, IsQuery, IsolationLevel, JoinQueryMethod, MapTableScopesOption, MaybeArray, MergeQuery, PickQuerySelectableRelations, QueryAfterHook, QueryBeforeActionHook, QueryBeforeHook, QueryData, QueryHasWhere, QueryManyTake, QueryManyTakeOptional, QueryOrExpression, QueryReturnType, QuerySchema, QueryScopes, RecordUnknown, RelationConfigBase, Rls, SelectableFromShape, ShallowSimplify, ShapeColumnPrimaryKeys, ShapeUniqueColumns, StorageOptions, TableData, TableDataFn, TableDataItem, TableDataItemsUniqueColumnTuples, TableDataItemsUniqueColumns, TableDataItemsUniqueConstraints, TransactionOptions, UniqueConstraints, UpdateData, WhereArg } from "pqb/internal";
1
+ import { Adapter, AfterCommitStandaloneHook, AfterHook, Column, ColumnSchemaConfig, ColumnsShape, ComputedColumnsFromOptions, ComputedOptionsConfig, ComputedOptionsFactory, CreateData, CreateManyMethodsNames, CreateMethodsNames, CreateSelf, DbSharedOptions, DbSqlMethod, DbTableOptionScopes, DefaultColumnTypes, DefaultSchemaConfig, DeleteMethodsNames, EmptyObject, FromArg, FromResult, Grant, IsQuery, IsolationLevel, JoinQueryMethod, MapTableScopesOption, MaybeArray, MergeQuery, PickQuerySelectableRelations, QueryAfterHook, QueryBeforeActionHook, QueryBeforeHook, QueryData, QueryHasWhere, QueryReturnType, QuerySchema, QueryScopes, RawSqlBase, RecordUnknown, RelationConfigBase, Rls, SelectableFromShape, ShallowSimplify, ShapeColumnPrimaryKeys, ShapeUniqueColumns, StorageOptions, TableData, TableDataFn, TableDataItem, TableDataItemsUniqueColumnTuples, TableDataItemsUniqueColumns, TableDataItemsUniqueConstraints, TransactionOptions, UniqueConstraints, UpdateData, WhereArg } from "pqb/internal";
2
2
  import { Db, Query } from "pqb";
3
3
  export * from "pqb";
4
4
  interface RelationRefsOptions<Column extends PropertyKey = string, Shape extends Column.Shape.QueryInit = Column.Shape.QueryInit> {
@@ -25,15 +25,14 @@ type HasOneQueryThrough<Name extends string, TableQuery extends Query> = { [K in
25
25
  type HasOneQuery<T extends RelationConfigSelf, Name extends string, TableQuery extends Query> = T['relations'][Name]['options'] extends RelationRefsOptions ? { [K in keyof TableQuery]: K extends '__defaults' ? { [K in keyof TableQuery['__defaults'] | T['relations'][Name]['options']['references'][number]]: true } : K extends '__selectable' ? SelectableFromShape<TableQuery['shape'], Name> : K extends '__as' ? Name : K extends CreateManyMethodsNames ? never : TableQuery[K] } & QueryHasWhere & HasRelJoin : HasOneQueryThrough<Name, TableQuery>;
26
26
  interface HasOneInfo<T extends RelationConfigSelf, Name extends string, Rel extends HasOne, Q extends Query> extends RelationConfigBase {
27
27
  returnsOne: true;
28
+ required: T['relations'][Name]['options']['required'];
28
29
  query: Q;
29
30
  params: HasOneParams<T, Rel['options']>;
30
- maybeSingle: T['relations'][Name]['options']['required'] extends true ? QueryManyTake<Q> : QueryManyTakeOptional<Q>;
31
31
  omitForeignKeyInCreate: never;
32
- optionalDataForCreate: Q extends Query.Pick.IsNotReadOnly ? T['relations'][Name]['options'] extends RelationThroughOptions ? EmptyObject : { [P in Name]?: RelationToOneDataForCreate<{
32
+ dataForCreate: { [K in Name]?: Q extends Query.Pick.IsNotReadOnly ? T['relations'][Name]['options'] extends RelationThroughOptions ? EmptyObject : RelationToOneDataForCreate<{
33
33
  nestedCreateQuery: CreateData<Q>;
34
34
  table: Q;
35
- }> } : EmptyObject;
36
- dataForCreate: undefined;
35
+ }> : never };
37
36
  dataForUpdate: Q extends Query.Pick.IsNotReadOnly ? {
38
37
  disconnect: boolean;
39
38
  } | {
@@ -67,17 +66,15 @@ interface HasManyInfo<T extends RelationConfigSelf, Name extends string, Rel ext
67
66
  returnsOne: false;
68
67
  query: Q;
69
68
  params: HasOneParams<T, Rel['options']>;
70
- maybeSingle: Q;
71
69
  omitForeignKeyInCreate: never;
72
- optionalDataForCreate: Q extends Query.Pick.IsNotReadOnly ? { [P in Name]?: T['relations'][Name]['options'] extends RelationThroughOptions ? EmptyObject : {
70
+ dataForCreate: { [K in Name]?: Q extends Query.Pick.IsNotReadOnly ? T['relations'][Name]['options'] extends RelationThroughOptions ? never : {
73
71
  create?: CreateData<Q>[];
74
72
  connect?: WhereArg<Q>[];
75
73
  connectOrCreate?: {
76
74
  where: WhereArg<Q>;
77
75
  create: CreateData<Q>;
78
76
  }[];
79
- } } : EmptyObject;
80
- dataForCreate: undefined;
77
+ } : never };
81
78
  dataForUpdate: Q extends Query.Pick.IsNotReadOnly ? {
82
79
  disconnect?: MaybeArray<WhereArg<Q>>;
83
80
  delete?: MaybeArray<WhereArg<Q>>;
@@ -124,15 +121,14 @@ type BelongsToParams<T extends RelationConfigSelf, FK extends string> = { [Name
124
121
  type BelongsToQuery<T extends Query, Name extends string> = { [P in keyof T]: P extends '__selectable' ? SelectableFromShape<T['shape'], Name> : P extends '__as' ? Name : P extends CreateMethodsNames | DeleteMethodsNames ? never : T[P] } & QueryHasWhere & HasRelJoin;
125
122
  interface BelongsToInfo<T extends RelationConfigSelf, Name extends string, FK extends string, Required, Q extends Query> extends RelationConfigBase {
126
123
  returnsOne: true;
124
+ required: Required;
127
125
  query: Q;
128
126
  params: BelongsToParams<T, FK>;
129
- maybeSingle: Required extends true ? QueryManyTake<Q> : QueryManyTakeOptional<Q>;
130
127
  omitForeignKeyInCreate: FK;
131
128
  dataForCreate: {
132
129
  columns: FK;
133
- nested: Q extends Query.Pick.IsNotReadOnly ? Required extends true ? { [Key in Name]: RelationToOneDataForCreateSameQuery<Q> } : { [Key in Name]?: RelationToOneDataForCreateSameQuery<Q> } : never;
130
+ nested: Q extends Query.Pick.IsNotReadOnly ? Required extends true ? { [Key in Name]: RelationToOneDataForCreateSameQuery<Q> } : { [Key in Name]?: RelationToOneDataForCreateSameQuery<Q> } : { [Key in Name]?: never };
134
131
  };
135
- optionalDataForCreate: EmptyObject;
136
132
  dataForUpdate: {
137
133
  disconnect: boolean;
138
134
  } | {
@@ -161,6 +157,132 @@ interface BelongsToInfo<T extends RelationConfigSelf, Name extends string, FK ex
161
157
  };
162
158
  } : never);
163
159
  }
160
+ interface HasAndBelongsToMany extends RelationThunkBase {
161
+ type: 'hasAndBelongsToMany';
162
+ options: HasAndBelongsToManyOptions;
163
+ }
164
+ interface HasAndBelongsToManyOptions<Columns extends Column.Shape.QueryInit = Column.Shape.QueryInit, Related extends ORMTableInput = ORMTableInput> {
165
+ required?: boolean;
166
+ columns: (keyof Columns)[];
167
+ references: string[];
168
+ foreignKey?: boolean | TableData.References.Options;
169
+ through: {
170
+ schema?: QuerySchema;
171
+ table: string;
172
+ columns: string[];
173
+ references: (keyof Related['columns']['shape'])[];
174
+ foreignKey?: boolean | TableData.References.Options;
175
+ };
176
+ on?: ColumnsShape.InputPartial<Related['columns']['shape']>;
177
+ }
178
+ type HasAndBelongsToManyParams<T extends RelationConfigSelf, FK extends string> = { [Name in FK]: T['columns']['shape'][Name]['type'] };
179
+ type HasAndBelongsToManyQuery<Name extends string, TableQuery extends Query> = { [K in keyof TableQuery]: K extends '__selectable' ? SelectableFromShape<TableQuery['shape'], Name> : K extends '__as' ? Name : TableQuery[K] } & QueryHasWhere & HasRelJoin;
180
+ interface HasAndBelongsToManyInfo<T extends RelationConfigSelf, Name extends string, FK extends string, Q extends Query> extends RelationConfigBase {
181
+ returnsOne: false;
182
+ query: Q;
183
+ params: HasAndBelongsToManyParams<T, FK>;
184
+ omitForeignKeyInCreate: never;
185
+ dataForCreate: { [K in Name]?: Q extends Query.Pick.IsNotReadOnly ? {
186
+ create?: CreateData<Q>[];
187
+ connect?: WhereArg<Q>[];
188
+ connectOrCreate?: {
189
+ where: WhereArg<Q>;
190
+ create: CreateData<Q>;
191
+ }[];
192
+ } : {
193
+ connect?: WhereArg<Q>[];
194
+ } };
195
+ dataForUpdate: Q extends Query.Pick.IsNotReadOnly ? {
196
+ disconnect?: MaybeArray<WhereArg<Q>>;
197
+ set?: MaybeArray<WhereArg<Q>>;
198
+ add?: MaybeArray<WhereArg<Q>>;
199
+ delete?: MaybeArray<WhereArg<Q>>;
200
+ update?: {
201
+ where: MaybeArray<WhereArg<Q>>;
202
+ data: UpdateData<Q>;
203
+ };
204
+ create?: CreateData<Q>[];
205
+ } : {
206
+ disconnect?: MaybeArray<WhereArg<Q>>;
207
+ set?: MaybeArray<WhereArg<Q>>;
208
+ add?: MaybeArray<WhereArg<Q>>;
209
+ };
210
+ dataForUpdateOne: Q extends Query.Pick.IsNotReadOnly ? {
211
+ disconnect?: MaybeArray<WhereArg<Q>>;
212
+ set?: MaybeArray<WhereArg<Q>>;
213
+ add?: MaybeArray<WhereArg<Q>>;
214
+ delete?: MaybeArray<WhereArg<Q>>;
215
+ update?: {
216
+ where: MaybeArray<WhereArg<Q>>;
217
+ data: UpdateData<Q>;
218
+ };
219
+ create?: CreateData<Q>[];
220
+ upsert?: {
221
+ findBy: Q['internal']['uniqueColumns'];
222
+ update: UpdateData<Q>;
223
+ create?: CreateData<Q> | (() => CreateData<Q>);
224
+ };
225
+ } : {
226
+ disconnect?: MaybeArray<WhereArg<Q>>;
227
+ set?: MaybeArray<WhereArg<Q>>;
228
+ add?: MaybeArray<WhereArg<Q>>;
229
+ };
230
+ }
231
+ type RelationToOneDataForCreate<Rel extends {
232
+ nestedCreateQuery: unknown;
233
+ table: Query;
234
+ }> = {
235
+ create: Rel['nestedCreateQuery'];
236
+ connect?: never;
237
+ connectOrCreate?: never;
238
+ } | {
239
+ create?: never;
240
+ connect: WhereArg<Rel['table']>;
241
+ connectOrCreate?: never;
242
+ } | {
243
+ create?: never;
244
+ connect?: never;
245
+ connectOrCreate: {
246
+ where: WhereArg<Rel['table']>;
247
+ create: Rel['nestedCreateQuery'];
248
+ };
249
+ };
250
+ interface RelationToOneDataForCreateSameQuerySelf extends CreateSelf, PickQuerySelectableRelations {}
251
+ type RelationToOneDataForCreateSameQuery<Q extends RelationToOneDataForCreateSameQuerySelf> = {
252
+ create: CreateData<Q>;
253
+ connect?: never;
254
+ connectOrCreate?: never;
255
+ } | {
256
+ create?: never;
257
+ connect: WhereArg<Q>;
258
+ connectOrCreate?: never;
259
+ } | {
260
+ create?: never;
261
+ connect?: never;
262
+ connectOrCreate: {
263
+ where: WhereArg<Q>;
264
+ create: CreateData<Q>;
265
+ };
266
+ };
267
+ interface RelationThunkBase {
268
+ type: string;
269
+ related: ORMTableInput;
270
+ options: unknown;
271
+ }
272
+ type RelationThunk = BelongsTo | HasOne | HasMany | HasAndBelongsToMany;
273
+ interface RelationThunks {
274
+ [K: string]: RelationThunk;
275
+ }
276
+ type RelationTableToQuery<Relation> = Relation extends {
277
+ related: infer R extends ORMTableInput;
278
+ } ? TableToDb<R, R['table'] extends string ? R['table'] : R['name'], R['table'] extends string ? R['readOnly'] extends true ? true : undefined : R['readOnly'] extends false ? undefined : true> : never;
279
+ interface RelationConfigSelf {
280
+ columns: {
281
+ shape: Column.Shape.QueryInit;
282
+ };
283
+ relations: RelationThunks;
284
+ }
285
+ type RelationConfigParams<T extends RelationConfigSelf, Relation extends RelationThunk> = Relation extends BelongsTo ? BelongsToParams<T, Relation['options']['columns'][number] & string> : Relation extends HasOne | HasMany ? HasOneParams<T, Relation['options']> : Relation extends HasAndBelongsToMany ? HasAndBelongsToManyParams<T, Relation['options']['columns'][number] & string> : never;
164
286
  declare function transaction<Result>(this: {
165
287
  $qb: Db;
166
288
  }, fn: () => Promise<Result>): Promise<Result>;
@@ -200,11 +322,22 @@ interface OrchidORMTableHelper<T extends Query> {
200
322
  }
201
323
  type OrchidORMTables<T extends TableClasses = TableClasses> = { [K in keyof T]: T[K] extends {
202
324
  new (): infer R extends ORMTableInput;
203
- } ? OrchidORMTableHelper<TableToDb<R>> : never };
325
+ } ? OrchidORMTableHelper<TableToDb<R, R['table'], R['readOnly'] extends true ? true : undefined>> : never };
326
+ type OrchidORMViews<T extends TableClasses = TableClasses> = { [K in keyof T]: T[K] extends {
327
+ new (): infer R extends ORMTableInput;
328
+ } ? OrchidORMTableHelper<TableToDb<R, R['name'], R['readOnly'] extends false ? undefined : true, R['materialized'] extends true ? true : undefined>> : never };
329
+ type OrchidORMBundle<T extends TableClasses = TableClasses, V extends TableClasses = TableClasses> = OrchidORMTables<T> & {
330
+ $views: OrchidORMViews<V>;
331
+ };
204
332
  type OrchidORMDbTables<T extends TableClasses = TableClasses> = { [K in keyof T]: T[K] extends {
205
333
  new (): infer R extends ORMTableInput;
206
- } ? TableToDb<R> : never };
207
- type OrchidORM<T extends TableClasses = TableClasses> = OrchidORMDbTables<T> & OrchidORMMethods;
334
+ } ? TableToDb<R, R['table'], R['readOnly'] extends true ? true : undefined> : never };
335
+ type OrchidORMDbViews<T extends TableClasses = TableClasses> = { [K in keyof T]: T[K] extends {
336
+ new (): infer R extends ORMTableInput;
337
+ } ? TableToDb<R, R['name'], R['readOnly'] extends false ? undefined : true, R['materialized'] extends true ? true : undefined> : never };
338
+ type OrchidORM<T extends TableClasses = TableClasses, V extends TableClasses = TableClasses> = OrchidORMDbTables<T> & {
339
+ $views: OrchidORMDbViews<V>;
340
+ } & OrchidORMMethods;
208
341
  /**
209
342
  * Identity helper for table row-level security configuration.
210
343
  */
@@ -360,145 +493,30 @@ interface OrchidORMMethods {
360
493
  $close(): Promise<void>;
361
494
  }
362
495
  type OrchidOrmParam<Options> = true | null extends true ? 'Set strict: true to tsconfig' : Options;
363
- declare const bundleOrchidORMTables: <T extends TableClasses>(tables: T) => OrchidORMTables<T>;
364
- declare const makeOrchidOrmDbWithAdapter: <T extends TableClasses>(orm: OrchidORMTables<T>, options: OrchidOrmParam<({
496
+ interface OrchidORMSetupOptions<V extends TableClasses = TableClasses> extends DbSharedOptions {
497
+ /**
498
+ * First-class regular views exposed under db.$views.
499
+ */
500
+ views?: V;
501
+ }
502
+ declare const bundleOrchidORM: <T extends TableClasses = EmptyObject, V extends TableClasses = EmptyObject>({
503
+ tables,
504
+ views
505
+ }: {
506
+ tables?: T;
507
+ views?: V;
508
+ }) => OrchidORMBundle<T, V>;
509
+ declare const bundleOrchidORMTables: <T extends TableClasses>(tables: T) => OrchidORMBundle<T, EmptyObject>;
510
+ declare const makeOrchidOrmDbWithAdapter: <T extends TableClasses, V extends TableClasses>(orm: OrchidORMBundle<T, V>, options: OrchidOrmParam<({
365
511
  db: Query;
366
512
  } | {
367
513
  adapter: Adapter;
368
- }) & DbSharedOptions>) => OrchidORM<T>;
369
- declare const orchidORMWithAdapter: <T extends TableClasses>(options: OrchidOrmParam<({
514
+ }) & DbSharedOptions>) => OrchidORM<T, V>;
515
+ declare const orchidORMWithAdapter: <T extends TableClasses, V extends TableClasses = EmptyObject>(options: OrchidOrmParam<({
370
516
  db: Query;
371
517
  } | {
372
518
  adapter: Adapter;
373
- }) & DbSharedOptions>, tables: T) => OrchidORM<T>;
374
- interface HasAndBelongsToMany extends RelationThunkBase {
375
- type: 'hasAndBelongsToMany';
376
- options: HasAndBelongsToManyOptions;
377
- }
378
- interface HasAndBelongsToManyOptions<Columns extends Column.Shape.QueryInit = Column.Shape.QueryInit, Related extends ORMTableInput = ORMTableInput> {
379
- required?: boolean;
380
- columns: (keyof Columns)[];
381
- references: string[];
382
- foreignKey?: boolean | TableData.References.Options;
383
- through: {
384
- schema?: QuerySchema;
385
- table: string;
386
- columns: string[];
387
- references: (keyof Related['columns']['shape'])[];
388
- foreignKey?: boolean | TableData.References.Options;
389
- };
390
- on?: ColumnsShape.InputPartial<Related['columns']['shape']>;
391
- }
392
- type HasAndBelongsToManyParams<T extends RelationConfigSelf, FK extends string> = { [Name in FK]: T['columns']['shape'][Name]['type'] };
393
- type HasAndBelongsToManyQuery<Name extends string, TableQuery extends Query> = { [K in keyof TableQuery]: K extends '__selectable' ? SelectableFromShape<TableQuery['shape'], Name> : K extends '__as' ? Name : TableQuery[K] } & QueryHasWhere & HasRelJoin;
394
- interface HasAndBelongsToManyInfo<T extends RelationConfigSelf, Name extends string, FK extends string, Q extends Query> extends RelationConfigBase {
395
- returnsOne: false;
396
- query: Q;
397
- params: HasAndBelongsToManyParams<T, FK>;
398
- maybeSingle: Q;
399
- omitForeignKeyInCreate: never;
400
- optionalDataForCreate: { [P in Name]?: Q extends Query.Pick.IsNotReadOnly ? {
401
- create?: CreateData<Q>[];
402
- connect?: WhereArg<Q>[];
403
- connectOrCreate?: {
404
- where: WhereArg<Q>;
405
- create: CreateData<Q>;
406
- }[];
407
- } : {
408
- connect?: WhereArg<Q>[];
409
- } };
410
- dataForCreate: undefined;
411
- dataForUpdate: Q extends Query.Pick.IsNotReadOnly ? {
412
- disconnect?: MaybeArray<WhereArg<Q>>;
413
- set?: MaybeArray<WhereArg<Q>>;
414
- add?: MaybeArray<WhereArg<Q>>;
415
- delete?: MaybeArray<WhereArg<Q>>;
416
- update?: {
417
- where: MaybeArray<WhereArg<Q>>;
418
- data: UpdateData<Q>;
419
- };
420
- create?: CreateData<Q>[];
421
- } : {
422
- disconnect?: MaybeArray<WhereArg<Q>>;
423
- set?: MaybeArray<WhereArg<Q>>;
424
- add?: MaybeArray<WhereArg<Q>>;
425
- };
426
- dataForUpdateOne: Q extends Query.Pick.IsNotReadOnly ? {
427
- disconnect?: MaybeArray<WhereArg<Q>>;
428
- set?: MaybeArray<WhereArg<Q>>;
429
- add?: MaybeArray<WhereArg<Q>>;
430
- delete?: MaybeArray<WhereArg<Q>>;
431
- update?: {
432
- where: MaybeArray<WhereArg<Q>>;
433
- data: UpdateData<Q>;
434
- };
435
- create?: CreateData<Q>[];
436
- upsert?: {
437
- findBy: Q['internal']['uniqueColumns'];
438
- update: UpdateData<Q>;
439
- create?: CreateData<Q> | (() => CreateData<Q>);
440
- };
441
- } : {
442
- disconnect?: MaybeArray<WhereArg<Q>>;
443
- set?: MaybeArray<WhereArg<Q>>;
444
- add?: MaybeArray<WhereArg<Q>>;
445
- };
446
- }
447
- type RelationToOneDataForCreate<Rel extends {
448
- nestedCreateQuery: unknown;
449
- table: Query;
450
- }> = {
451
- create: Rel['nestedCreateQuery'];
452
- connect?: never;
453
- connectOrCreate?: never;
454
- } | {
455
- create?: never;
456
- connect: WhereArg<Rel['table']>;
457
- connectOrCreate?: never;
458
- } | {
459
- create?: never;
460
- connect?: never;
461
- connectOrCreate: {
462
- where: WhereArg<Rel['table']>;
463
- create: Rel['nestedCreateQuery'];
464
- };
465
- };
466
- interface RelationToOneDataForCreateSameQuerySelf extends CreateSelf, PickQuerySelectableRelations {}
467
- type RelationToOneDataForCreateSameQuery<Q extends RelationToOneDataForCreateSameQuerySelf> = {
468
- create: CreateData<Q>;
469
- connect?: never;
470
- connectOrCreate?: never;
471
- } | {
472
- create?: never;
473
- connect: WhereArg<Q>;
474
- connectOrCreate?: never;
475
- } | {
476
- create?: never;
477
- connect?: never;
478
- connectOrCreate: {
479
- where: WhereArg<Q>;
480
- create: CreateData<Q>;
481
- };
482
- };
483
- interface RelationThunkBase {
484
- type: string;
485
- related: ORMTableInput;
486
- options: unknown;
487
- }
488
- type RelationThunk = BelongsTo | HasOne | HasMany | HasAndBelongsToMany;
489
- interface RelationThunks {
490
- [K: string]: RelationThunk;
491
- }
492
- type RelationTableToQuery<Relation> = Relation extends {
493
- related: infer R extends ORMTableInput;
494
- } ? TableToDb<R> : never;
495
- interface RelationConfigSelf {
496
- columns: {
497
- shape: Column.Shape.QueryInit;
498
- };
499
- relations: RelationThunks;
500
- }
501
- type RelationConfigParams<T extends RelationConfigSelf, Relation extends RelationThunk> = Relation extends BelongsTo ? BelongsToParams<T, Relation['options']['columns'][number] & string> : Relation extends HasOne | HasMany ? HasOneParams<T, Relation['options']> : Relation extends HasAndBelongsToMany ? HasAndBelongsToManyParams<T, Relation['options']['columns'][number] & string> : never;
519
+ }) & OrchidORMSetupOptions<V>>, tables: T) => OrchidORM<T, V>;
502
520
  interface TableClass<T extends ORMTableInput = ORMTableInput> {
503
521
  new (): T;
504
522
  }
@@ -512,24 +530,28 @@ interface TableInfo {
512
530
  name: string;
513
531
  }
514
532
  interface Table extends Query, TableInfo {}
515
- interface TableToDb<T extends ORMTableInput> extends TableInfo, Db<T['table'], T['columns']['shape'], keyof ShapeColumnPrimaryKeys<T['columns']['shape']> extends never ? never : ShapeColumnPrimaryKeys<T['columns']['shape']>, ShapeUniqueColumns<T['columns']['shape']> | TableDataItemsUniqueColumns<T['columns']['shape'], T['columns']['data']>, TableDataItemsUniqueColumnTuples<T['columns']['shape'], T['columns']['data']>, UniqueConstraints<T['columns']['shape']> | TableDataItemsUniqueConstraints<T['columns']['data']>, T['types'], T['columns']['shape'] & ComputedColumnsFromOptions<T['computed']>, MapTableScopesOption<T>, ColumnsShape.DefaultSelectKeys<T['columns']['shape']>, T['readOnly'] extends true ? true : undefined> {
533
+ interface TableToDb<T extends ORMTableInput, Name extends string | undefined, ReadOnly extends true | undefined, Materialized extends true | undefined = undefined> extends TableInfo, Db<Name, T['columns']['shape'], keyof ShapeColumnPrimaryKeys<T['columns']['shape']> extends never ? never : ShapeColumnPrimaryKeys<T['columns']['shape']>, ShapeUniqueColumns<T['columns']['shape']> | TableDataItemsUniqueColumns<T['columns']['shape'], T['columns']['data']>, TableDataItemsUniqueColumnTuples<T['columns']['shape'], T['columns']['data']>, UniqueConstraints<T['columns']['shape']> | TableDataItemsUniqueConstraints<T['columns']['data']>, T['types'], T['columns']['shape'] & ComputedColumnsFromOptions<T['computed']>, MapTableScopesOption<T>, ColumnsShape.DefaultSelectKeys<T['columns']['shape']>, ReadOnly, Materialized> {
516
534
  relations: T extends RelationConfigSelf ? { [K in keyof T['relations'] & string]: T['relations'][K] extends BelongsTo ? BelongsToInfo<T, K, T['relations'][K]['options']['columns'][number] & string, T['relations'][K]['options']['required'], BelongsToQuery<RelationTableToQuery<T['relations'][K]>, K>> : T['relations'][K] extends HasOne ? HasOneInfo<T, K, T['relations'][K], HasOneQuery<T, K, RelationTableToQuery<T['relations'][K]>>> : T['relations'][K] extends HasMany ? HasManyInfo<T, K, T['relations'][K], HasManyQuery<T, K, RelationTableToQuery<T['relations'][K]>>> : T['relations'][K] extends HasAndBelongsToMany ? HasAndBelongsToManyInfo<T, K, T['relations'][K]['options']['columns'][number] & string, HasAndBelongsToManyQuery<K, RelationTableToQuery<T['relations'][K]>>> : never } : EmptyObject;
517
535
  }
518
- interface ORMTableInput {
519
- table: string;
536
+ interface PickORMTableInputColumns {
520
537
  columns: {
521
538
  shape: Column.Shape.QueryInit;
522
539
  data: MaybeArray<TableDataItem>;
523
540
  };
524
- schema?: QuerySchema;
525
- types: unknown;
526
- noPrimaryKey?: boolean;
527
- filePath: string;
528
- language?: string;
541
+ }
542
+ interface PickORMTableComputed {
529
543
  /**
530
544
  * collect computed columns returned by {@link BaseTable.setColumns}
531
545
  */
532
546
  computed?: ComputedOptionsFactory<never, never>;
547
+ }
548
+ interface PickORMTableInputColumnsAndComputed extends PickORMTableInputColumns, PickORMTableComputed {}
549
+ interface ORMTableInput extends PickORMTableInputColumnsAndComputed {
550
+ autoForeignKeys?: TableData.References.BaseOptions | boolean;
551
+ schema?: QuerySchema;
552
+ types: unknown;
553
+ filePath: string;
554
+ language?: string;
533
555
  scopes?: RecordUnknown;
534
556
  readonly softDelete?: true | string;
535
557
  comment?: string;
@@ -539,17 +561,30 @@ interface ORMTableInput {
539
561
  */
540
562
  grants?: readonly Grant.TableClassGrant[];
541
563
  readonly readOnly?: boolean;
542
- autoForeignKeys?: TableData.References.BaseOptions | boolean;
564
+ readonly materialized?: true;
565
+ table?: string;
566
+ noPrimaryKey?: boolean;
567
+ name?: string;
568
+ sql?: string | RawSqlBase;
569
+ recursive?: boolean;
570
+ checkOption?: 'LOCAL' | 'CASCADED';
571
+ securityBarrier?: boolean;
572
+ securityInvoker?: boolean;
573
+ withData?: boolean;
543
574
  }
544
- type Queryable<T extends ORMTableInput> = ShallowSimplify<{ [K in keyof T['columns']['shape']]?: T['columns']['shape'][K]['queryType'] }>;
545
- type DefaultSelect<T extends ORMTableInput> = ShallowSimplify<ColumnsShape.DefaultOutput<T['columns']['shape']>>;
546
- type Selectable<T extends ORMTableInput> = T['computed'] extends ((t: never) => infer R extends ComputedOptionsConfig) ? ShallowSimplify<ColumnsShape.Output<T['columns']['shape']> & { [K in keyof R]: R[K] extends QueryOrExpression<unknown> ? R[K]['result']['value']['outputType'] : R[K] extends (() => {
575
+ type Queryable<T extends PickORMTableInputColumns> = ShallowSimplify<{ [K in keyof T['columns']['shape']]?: T['columns']['shape'][K]['queryType'] }>;
576
+ type DefaultSelect<T extends PickORMTableInputColumns> = ShallowSimplify<ColumnsShape.DefaultOutput<T['columns']['shape']>>;
577
+ type Selectable<T extends PickORMTableInputColumnsAndComputed> = T['computed'] extends ((t: never) => infer R extends ComputedOptionsConfig) ? ShallowSimplify<ColumnsShape.Output<T['columns']['shape']> & { [K in keyof R]: R[K] extends {
578
+ result: {
579
+ value: infer Value extends Column.Pick.QueryColumn;
580
+ };
581
+ } ? Value['outputType'] : R[K] extends (() => {
547
582
  result: {
548
583
  value: infer Value extends Column.Pick.QueryColumn;
549
584
  };
550
585
  }) ? Value['outputType'] : never }> : ShallowSimplify<ColumnsShape.Output<T['columns']['shape']>>;
551
- type Insertable<T extends ORMTableInput> = ShallowSimplify<ColumnsShape.Input<T['columns']['shape']>>;
552
- type Updatable<T extends ORMTableInput> = ShallowSimplify<ColumnsShape.InputPartial<T['columns']['shape']>>;
586
+ type Insertable<T extends PickORMTableInputColumns> = ShallowSimplify<ColumnsShape.Input<T['columns']['shape']>>;
587
+ type Updatable<T extends PickORMTableInputColumns> = ShallowSimplify<ColumnsShape.InputPartial<T['columns']['shape']>>;
553
588
  type BeforeHookMethod = (cb: QueryBeforeHook) => void;
554
589
  type BeforeActionHookMethod = (cb: QueryBeforeActionHook) => void;
555
590
  type AfterHookMethod = (cb: QueryAfterHook) => void;
@@ -563,7 +598,7 @@ interface SetColumnsResult<Shape extends Column.Shape.QueryInit, Data extends Ma
563
598
  data: Data extends unknown[] ? Data : [Data];
564
599
  }
565
600
  interface BaseTableInstance<ColumnTypes> {
566
- table: string;
601
+ table?: string;
567
602
  columns: {
568
603
  shape: Column.Shape.QueryInit;
569
604
  data: MaybeArray<TableDataItem>;
@@ -677,8 +712,11 @@ interface BaseTableInstance<ColumnTypes> {
677
712
  /**
678
713
  * See {@link ScopeMethods}
679
714
  */
680
- setScopes<Table extends string, Shape extends Column.Shape.QueryInit, Keys extends string>(this: {
715
+ setScopes<Table extends string, Shape extends Column.Shape.QueryInit, Keys extends string>(this: ({
681
716
  table: Table;
717
+ } | {
718
+ name: Table;
719
+ }) & {
682
720
  columns: {
683
721
  shape: Shape;
684
722
  };
@@ -748,6 +786,8 @@ interface BaseTableClass<SchemaConfig extends ColumnSchemaConfig, ColumnTypes> {
748
786
  columnTypes: ColumnTypes;
749
787
  getFilePath(): string;
750
788
  sql: DbSqlMethod<ColumnTypes>;
789
+ View: TableClass<BaseViewInstance<ColumnTypes>>;
790
+ MaterializedView: TableClass<BaseMaterializedViewInstance<ColumnTypes>>;
751
791
  new (): BaseTableInstance<ColumnTypes>;
752
792
  instance(): BaseTableInstance<ColumnTypes>;
753
793
  /**
@@ -777,6 +817,22 @@ interface BaseTableClass<SchemaConfig extends ColumnSchemaConfig, ColumnTypes> {
777
817
  */
778
818
  updateSchema: SchemaConfig['updateSchema'];
779
819
  }
820
+ interface BaseViewInstance<ColumnTypes> extends BaseTableInstance<ColumnTypes> {
821
+ name: string;
822
+ sql: string | RawSqlBase;
823
+ readonly readOnly?: boolean;
824
+ recursive?: boolean;
825
+ checkOption?: 'LOCAL' | 'CASCADED';
826
+ securityBarrier?: boolean;
827
+ securityInvoker?: boolean;
828
+ }
829
+ interface BaseMaterializedViewInstance<ColumnTypes> extends BaseTableInstance<ColumnTypes> {
830
+ name: string;
831
+ sql: string | RawSqlBase;
832
+ readonly readOnly?: true;
833
+ readonly materialized: true;
834
+ withData?: boolean;
835
+ }
780
836
  declare function createBaseTable<SchemaConfig extends ColumnSchemaConfig = DefaultSchemaConfig, ColumnTypes = DefaultColumnTypes<SchemaConfig>>({
781
837
  schemaConfig,
782
838
  columnTypes: columnTypesArg,
@@ -812,4 +868,4 @@ declare const createRepo: <T extends Query, Methods extends MethodsBase<T>>(tabl
812
868
  table: T["table"];
813
869
  shape: T["shape"];
814
870
  }>(q: Q) => Query & Q & MapMethods<T, Methods>) & T, Methods>;
815
- export { BaseTableClass, BaseTableInstance, DefaultSelect, FromQuery, Insertable, MapMethods, MapQueryMethods, MethodsBase, ORMTableInput, OrchidORM, OrchidORMDbTables, OrchidORMTableHelper, OrchidORMTables, OrchidOrmParam, Queryable, Repo, Selectable, SetColumnsResult, Table, TableClass, TableClasses, TableInfo, TableToDb, Updatable, bundleOrchidORMTables, createBaseTable, createRepo, defineRls, makeOrchidOrmDbWithAdapter, orchidORMWithAdapter, setGrants };
871
+ export { BaseMaterializedViewInstance, BaseTableClass, BaseTableInstance, BaseViewInstance, DefaultSelect, FromQuery, Insertable, MapMethods, MapQueryMethods, MethodsBase, ORMTableInput, OrchidORM, OrchidORMBundle, OrchidORMDbTables, OrchidORMDbViews, OrchidORMTableHelper, OrchidORMTables, OrchidORMViews, OrchidOrmParam, PickORMTableComputed, PickORMTableInputColumns, PickORMTableInputColumnsAndComputed, Queryable, Repo, Selectable, SetColumnsResult, Table, TableClass, TableClasses, TableInfo, TableToDb, Updatable, bundleOrchidORM, bundleOrchidORMTables, createBaseTable, createRepo, defineRls, makeOrchidOrmDbWithAdapter, orchidORMWithAdapter, setGrants };