@mikro-orm/sql 7.0.0-dev.216 → 7.0.0-dev.217

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/typings.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Generated, Kysely } from 'kysely';
2
- import type { DeferMode, CheckCallback, Dictionary, EntityProperty, GroupOperator, RawQueryFragment, QBFilterQuery, QueryOrderMap, Type, QueryFlag, EntityName, EntitySchemaWithMeta, Primary, PrimaryProperty, Opt } from '@mikro-orm/core';
2
+ import type { CheckCallback, DeferMode, Dictionary, EntityName, EntityProperty, EntitySchemaWithMeta, FilterQuery, GroupOperator, Opt, Primary, PrimaryProperty, QueryFlag, QueryOrderMap, RawQueryFragment, Type } from '@mikro-orm/core';
3
3
  import type { JoinType, QueryType } from './query/enums.js';
4
4
  import type { DatabaseSchema } from './schema/DatabaseSchema.js';
5
5
  import type { DatabaseTable } from './schema/DatabaseTable.js';
@@ -11,8 +11,8 @@ export interface Table {
11
11
  schema_name?: string;
12
12
  table_comment?: string;
13
13
  }
14
- type AnyString = string & {};
15
- export type Field<T> = AnyString | keyof T | RawQueryFragment | QueryBuilder | NativeQueryBuilder;
14
+ /** @internal */
15
+ export type InternalField<T> = string | RawQueryFragment | QueryBuilder | NativeQueryBuilder;
16
16
  export interface JoinOptions {
17
17
  table: string;
18
18
  schema?: string;
@@ -147,33 +147,31 @@ export interface SchemaDifference {
147
147
  export interface IQueryBuilder<T> {
148
148
  readonly alias: string;
149
149
  readonly type: QueryType;
150
- _fields?: Field<T>[];
150
+ /** @internal */
151
+ _fields?: InternalField<T>[];
151
152
  /** @internal */
152
153
  helper: any;
153
- select(fields: Field<T> | Field<T>[], distinct?: boolean): this;
154
+ select(fields: string | RawQueryFragment | (string | RawQueryFragment)[], distinct?: boolean): this;
154
155
  addSelect(fields: string | string[]): this;
155
156
  from<T extends object>(target: EntityName<T> | IQueryBuilder<T>, aliasName?: string): IQueryBuilder<T>;
156
157
  insert(data: any): this;
157
158
  update(data: any): this;
158
- delete(cond?: QBFilterQuery): this;
159
+ delete(cond?: FilterQuery<any>): this;
159
160
  truncate(): this;
160
161
  count(field?: string | string[], distinct?: boolean): this;
161
- join(field: string, alias: string, cond?: QBFilterQuery, type?: JoinType, path?: string): this;
162
- innerJoin(field: string, alias: string, cond?: QBFilterQuery): this;
163
- leftJoin(field: string, alias: string, cond?: QBFilterQuery): this;
164
- joinAndSelect(field: string, alias: string, cond?: QBFilterQuery): this;
165
- leftJoinAndSelect(field: string, alias: string, cond?: QBFilterQuery, fields?: string[]): this;
166
- innerJoinAndSelect(field: string, alias: string, cond?: QBFilterQuery, fields?: string[]): this;
162
+ join(field: string, alias: string, cond?: FilterQuery<any>, type?: JoinType, path?: string): this;
163
+ innerJoin(field: string, alias: string, cond?: FilterQuery<any>): this;
164
+ leftJoin(field: string, alias: string, cond?: FilterQuery<any>): this;
165
+ joinAndSelect(field: any, alias: string, cond?: FilterQuery<any>): this;
166
+ leftJoinAndSelect(field: any, alias: string, cond?: FilterQuery<any>, fields?: string[]): this;
167
+ innerJoinAndSelect(field: any, alias: string, cond?: FilterQuery<any>, fields?: string[]): this;
167
168
  withSubQuery(subQuery: RawQueryFragment | NativeQueryBuilder, alias: string): this;
168
- where(cond: QBFilterQuery<T>, operator?: keyof typeof GroupOperator): this;
169
- where(cond: string, params?: any[], operator?: keyof typeof GroupOperator): this;
170
- andWhere(cond: QBFilterQuery<T>): this;
171
- andWhere(cond: string, params?: any[]): this;
172
- orWhere(cond: QBFilterQuery<T>): this;
173
- orWhere(cond: string, params?: any[]): this;
169
+ where(cond: FilterQuery<T> | string | RawQueryFragment | Dictionary, operator?: keyof typeof GroupOperator | any[], operator2?: keyof typeof GroupOperator): this;
170
+ andWhere(cond: FilterQuery<T> | string | RawQueryFragment | Dictionary, params?: any[]): this;
171
+ orWhere(cond: FilterQuery<T> | string | RawQueryFragment | Dictionary, params?: any[]): this;
174
172
  orderBy(orderBy: QueryOrderMap<T>): this;
175
173
  groupBy(fields: (string | keyof T) | (string | keyof T)[]): this;
176
- having(cond?: QBFilterQuery | string, params?: any[]): this;
174
+ having(cond?: FilterQuery<any> | string, params?: any[]): this;
177
175
  getAliasForJoinPath(path: string, options?: ICriteriaNodeProcessOptions): string | undefined;
178
176
  getJoinForPath(path?: string, options?: ICriteriaNodeProcessOptions): JoinOptions | undefined;
179
177
  getNextAlias(entityName?: string | EntityName<T>): string;