@yandjin-mikro-orm/knex 6.1.4-rc-sti-changes-1
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/AbstractSqlConnection.d.ts +58 -0
- package/AbstractSqlConnection.js +206 -0
- package/AbstractSqlDriver.d.ts +73 -0
- package/AbstractSqlDriver.js +1378 -0
- package/AbstractSqlPlatform.d.ts +25 -0
- package/AbstractSqlPlatform.js +86 -0
- package/LICENSE +21 -0
- package/MonkeyPatchable.d.ts +11 -0
- package/MonkeyPatchable.js +39 -0
- package/PivotCollectionPersister.d.ts +17 -0
- package/PivotCollectionPersister.js +131 -0
- package/README.md +383 -0
- package/SqlEntityManager.d.ts +25 -0
- package/SqlEntityManager.js +40 -0
- package/SqlEntityRepository.d.ts +24 -0
- package/SqlEntityRepository.js +36 -0
- package/index.d.ts +18 -0
- package/index.js +40 -0
- package/index.mjs +215 -0
- package/package.json +71 -0
- package/query/ArrayCriteriaNode.d.ts +10 -0
- package/query/ArrayCriteriaNode.js +25 -0
- package/query/CriteriaNode.d.ts +31 -0
- package/query/CriteriaNode.js +147 -0
- package/query/CriteriaNodeFactory.d.ts +12 -0
- package/query/CriteriaNodeFactory.js +90 -0
- package/query/ObjectCriteriaNode.d.ts +15 -0
- package/query/ObjectCriteriaNode.js +233 -0
- package/query/QueryBuilder.d.ts +291 -0
- package/query/QueryBuilder.js +1445 -0
- package/query/QueryBuilderHelper.d.ts +64 -0
- package/query/QueryBuilderHelper.js +747 -0
- package/query/ScalarCriteriaNode.d.ts +10 -0
- package/query/ScalarCriteriaNode.js +56 -0
- package/query/enums.d.ts +15 -0
- package/query/enums.js +20 -0
- package/query/index.d.ts +8 -0
- package/query/index.js +24 -0
- package/schema/DatabaseSchema.d.ts +29 -0
- package/schema/DatabaseSchema.js +140 -0
- package/schema/DatabaseTable.d.ts +61 -0
- package/schema/DatabaseTable.js +727 -0
- package/schema/SchemaComparator.d.ts +59 -0
- package/schema/SchemaComparator.js +603 -0
- package/schema/SchemaHelper.d.ts +56 -0
- package/schema/SchemaHelper.js +274 -0
- package/schema/SqlSchemaGenerator.d.ts +63 -0
- package/schema/SqlSchemaGenerator.js +598 -0
- package/schema/index.d.ts +5 -0
- package/schema/index.js +21 -0
- package/typings.d.ts +174 -0
- package/typings.js +2 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Knex } from "knex";
|
|
2
|
+
import { type Dictionary, type EntityData, type EntityKey, type EntityMetadata, type EntityProperty, type FlatQueryOrderMap, LockMode, type QBFilterQuery } from "@yandjin-mikro-orm/core";
|
|
3
|
+
import { JoinType, QueryType } from "./enums";
|
|
4
|
+
import type { Field, JoinOptions } from "../typings";
|
|
5
|
+
import type { AbstractSqlDriver } from "../AbstractSqlDriver";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class QueryBuilderHelper {
|
|
10
|
+
private readonly entityName;
|
|
11
|
+
private readonly alias;
|
|
12
|
+
private readonly aliasMap;
|
|
13
|
+
private readonly subQueries;
|
|
14
|
+
private readonly knex;
|
|
15
|
+
private readonly driver;
|
|
16
|
+
private readonly platform;
|
|
17
|
+
private readonly metadata;
|
|
18
|
+
constructor(entityName: string, alias: string, aliasMap: Dictionary<Alias<any>>, subQueries: Dictionary<string>, knex: Knex, driver: AbstractSqlDriver);
|
|
19
|
+
mapper(field: string | Knex.Raw, type?: QueryType): string;
|
|
20
|
+
mapper(field: string | Knex.Raw, type?: QueryType, value?: any, alias?: string | null): string;
|
|
21
|
+
processData(data: Dictionary, convertCustomTypes: boolean, multi?: boolean): any;
|
|
22
|
+
joinOneToReference(prop: EntityProperty, ownerAlias: string, alias: string, type: JoinType, cond?: Dictionary, schema?: string): JoinOptions;
|
|
23
|
+
joinManyToOneReference(prop: EntityProperty, ownerAlias: string, alias: string, type: JoinType, cond?: Dictionary, schema?: string): JoinOptions;
|
|
24
|
+
joinManyToManyReference(prop: EntityProperty, ownerAlias: string, alias: string, pivotAlias: string, type: JoinType, cond: Dictionary, path: string, schema?: string): Dictionary<JoinOptions>;
|
|
25
|
+
processJoins(qb: Knex.QueryBuilder, joins: Dictionary<JoinOptions>, schema?: string): void;
|
|
26
|
+
private processJoinClause;
|
|
27
|
+
private wrapQueryGroup;
|
|
28
|
+
mapJoinColumns(type: QueryType, join: JoinOptions): (string | Knex.Raw)[];
|
|
29
|
+
isOneToOneInverse(field: string, meta?: EntityMetadata): boolean;
|
|
30
|
+
getTableName(entityName: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether the RE can be rewritten to simple LIKE query
|
|
33
|
+
*/
|
|
34
|
+
isSimpleRegExp(re: any): re is RegExp;
|
|
35
|
+
getRegExpParam(re: RegExp): string;
|
|
36
|
+
appendOnConflictClause<T>(type: QueryType, onConflict: {
|
|
37
|
+
fields: string[];
|
|
38
|
+
ignore?: boolean;
|
|
39
|
+
merge?: EntityData<T> | Field<T>[];
|
|
40
|
+
where?: QBFilterQuery<T>;
|
|
41
|
+
}[], qb: Knex.QueryBuilder): void;
|
|
42
|
+
appendQueryCondition(type: QueryType, cond: any, qb: Knex.QueryBuilder, operator?: "$and" | "$or", method?: "where" | "having"): void;
|
|
43
|
+
private appendQuerySubCondition;
|
|
44
|
+
private processObjectSubCondition;
|
|
45
|
+
private getOperatorReplacement;
|
|
46
|
+
getQueryOrder(type: QueryType, orderBy: FlatQueryOrderMap | FlatQueryOrderMap[], populate: Dictionary<string>): string[];
|
|
47
|
+
getQueryOrderFromObject(type: QueryType, orderBy: FlatQueryOrderMap, populate: Dictionary<string>): string[];
|
|
48
|
+
finalize(type: QueryType, qb: Knex.QueryBuilder, meta?: EntityMetadata, data?: Dictionary, returning?: Field<any>[]): void;
|
|
49
|
+
splitField<T>(field: EntityKey<T>, greedyAlias?: boolean): [string, EntityKey<T>, string | undefined];
|
|
50
|
+
getLockSQL(qb: Knex.QueryBuilder, lockMode: LockMode, lockTables?: string[]): void;
|
|
51
|
+
updateVersionProperty(qb: Knex.QueryBuilder, data: Dictionary): void;
|
|
52
|
+
private prefix;
|
|
53
|
+
private appendGroupCondition;
|
|
54
|
+
private isPrefixed;
|
|
55
|
+
private fieldName;
|
|
56
|
+
getProperty(field: string, alias?: string): EntityProperty | undefined;
|
|
57
|
+
isTableNameAliasRequired(type?: QueryType): boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface Alias<T> {
|
|
60
|
+
aliasName: string;
|
|
61
|
+
entityName: string;
|
|
62
|
+
metadata?: EntityMetadata<T>;
|
|
63
|
+
subQuery?: Knex.QueryBuilder;
|
|
64
|
+
}
|