@mikro-orm/sql 7.0.0-dev.114 → 7.0.0-dev.116

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, AnyEntity, EntityName, EntitySchemaWithMeta, Primary, PrimaryProperty, Opt } from '@mikro-orm/core';
2
+ import type { DeferMode, CheckCallback, Dictionary, EntityProperty, GroupOperator, RawQueryFragment, QBFilterQuery, QueryOrderMap, Type, QueryFlag, EntityName, EntitySchemaWithMeta, Primary, PrimaryProperty, Opt } 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';
@@ -137,7 +137,7 @@ export interface IQueryBuilder<T> {
137
137
  helper: any;
138
138
  select(fields: Field<T> | Field<T>[], distinct?: boolean): this;
139
139
  addSelect(fields: string | string[]): this;
140
- from<T extends AnyEntity<T> = AnyEntity>(target: EntityName<T> | IQueryBuilder<T>, aliasName?: string): IQueryBuilder<T>;
140
+ from<T extends object>(target: EntityName<T> | IQueryBuilder<T>, aliasName?: string): IQueryBuilder<T>;
141
141
  insert(data: any): this;
142
142
  update(data: any): this;
143
143
  delete(cond?: QBFilterQuery): this;
@@ -161,12 +161,13 @@ export interface IQueryBuilder<T> {
161
161
  having(cond?: QBFilterQuery | string, params?: any[]): this;
162
162
  getAliasForJoinPath(path: string, options?: ICriteriaNodeProcessOptions): string | undefined;
163
163
  getJoinForPath(path?: string, options?: ICriteriaNodeProcessOptions): JoinOptions | undefined;
164
- getNextAlias(entityName?: string): string;
165
- clone(reset?: boolean): IQueryBuilder<T>;
164
+ getNextAlias(entityName?: string | EntityName<T>): string;
165
+ clone(reset?: boolean | string[], preserve?: string[]): IQueryBuilder<T>;
166
166
  setFlag(flag: QueryFlag): this;
167
167
  unsetFlag(flag: QueryFlag): this;
168
168
  hasFlag(flag: QueryFlag): boolean;
169
169
  scheduleFilterCheck(path: string): void;
170
+ withSchema(schema: string): this;
170
171
  }
171
172
  export interface ICriteriaNodeProcessOptions {
172
173
  alias?: string;
@@ -177,7 +178,7 @@ export interface ICriteriaNodeProcessOptions {
177
178
  filter?: boolean;
178
179
  }
179
180
  export interface ICriteriaNode<T extends object> {
180
- readonly entityName: string;
181
+ readonly entityName: EntityName<T>;
181
182
  readonly parent?: ICriteriaNode<T> | undefined;
182
183
  readonly key?: string | symbol | undefined;
183
184
  readonly strict?: boolean;