@mikro-orm/sql 7.0.0-dev.97 → 7.0.0-dev.99

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.
Files changed (91) hide show
  1. package/AbstractSqlConnection.d.ts +57 -0
  2. package/AbstractSqlConnection.js +239 -0
  3. package/AbstractSqlDriver.d.ts +94 -0
  4. package/AbstractSqlDriver.js +1387 -0
  5. package/AbstractSqlPlatform.d.ts +38 -0
  6. package/AbstractSqlPlatform.js +104 -0
  7. package/LICENSE +21 -0
  8. package/PivotCollectionPersister.d.ts +22 -0
  9. package/PivotCollectionPersister.js +159 -0
  10. package/README.md +390 -0
  11. package/SqlEntityManager.d.ts +33 -0
  12. package/SqlEntityManager.js +44 -0
  13. package/SqlEntityRepository.d.ts +19 -0
  14. package/SqlEntityRepository.js +26 -0
  15. package/dialects/index.d.ts +4 -0
  16. package/dialects/index.js +4 -0
  17. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +14 -0
  18. package/dialects/mssql/MsSqlNativeQueryBuilder.js +200 -0
  19. package/dialects/mssql/index.d.ts +1 -0
  20. package/dialects/mssql/index.js +1 -0
  21. package/dialects/mysql/MySqlExceptionConverter.d.ts +9 -0
  22. package/dialects/mysql/MySqlExceptionConverter.js +80 -0
  23. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +7 -0
  24. package/dialects/mysql/MySqlNativeQueryBuilder.js +77 -0
  25. package/dialects/mysql/MySqlPlatform.d.ts +45 -0
  26. package/dialects/mysql/MySqlPlatform.js +116 -0
  27. package/dialects/mysql/MySqlSchemaHelper.d.ts +36 -0
  28. package/dialects/mysql/MySqlSchemaHelper.js +269 -0
  29. package/dialects/mysql/index.d.ts +4 -0
  30. package/dialects/mysql/index.js +4 -0
  31. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +5 -0
  32. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +8 -0
  33. package/dialects/postgresql/PostgreSqlTableCompiler.d.ts +1 -0
  34. package/dialects/postgresql/PostgreSqlTableCompiler.js +1 -0
  35. package/dialects/postgresql/index.d.ts +1 -0
  36. package/dialects/postgresql/index.js +1 -0
  37. package/dialects/sqlite/BaseSqliteConnection.d.ts +6 -0
  38. package/dialects/sqlite/BaseSqliteConnection.js +8 -0
  39. package/dialects/sqlite/BaseSqlitePlatform.d.ts +70 -0
  40. package/dialects/sqlite/BaseSqlitePlatform.js +104 -0
  41. package/dialects/sqlite/SqliteExceptionConverter.d.ts +9 -0
  42. package/dialects/sqlite/SqliteExceptionConverter.js +54 -0
  43. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +6 -0
  44. package/dialects/sqlite/SqliteNativeQueryBuilder.js +11 -0
  45. package/dialects/sqlite/SqliteSchemaHelper.d.ts +38 -0
  46. package/dialects/sqlite/SqliteSchemaHelper.js +379 -0
  47. package/dialects/sqlite/index.d.ts +5 -0
  48. package/dialects/sqlite/index.js +5 -0
  49. package/index.d.ts +19 -0
  50. package/index.js +19 -0
  51. package/package.json +3 -3
  52. package/plugin/index.d.ts +53 -0
  53. package/plugin/index.js +42 -0
  54. package/plugin/transformer.d.ts +115 -0
  55. package/plugin/transformer.js +883 -0
  56. package/query/ArrayCriteriaNode.d.ts +11 -0
  57. package/query/ArrayCriteriaNode.js +24 -0
  58. package/query/CriteriaNode.d.ts +29 -0
  59. package/query/CriteriaNode.js +121 -0
  60. package/query/CriteriaNodeFactory.d.ts +12 -0
  61. package/query/CriteriaNodeFactory.js +90 -0
  62. package/query/NativeQueryBuilder.d.ts +108 -0
  63. package/query/NativeQueryBuilder.js +425 -0
  64. package/query/ObjectCriteriaNode.d.ts +19 -0
  65. package/query/ObjectCriteriaNode.js +249 -0
  66. package/query/QueryBuilder.d.ts +389 -0
  67. package/query/QueryBuilder.js +1558 -0
  68. package/query/QueryBuilderHelper.d.ts +73 -0
  69. package/query/QueryBuilderHelper.js +756 -0
  70. package/query/ScalarCriteriaNode.d.ts +10 -0
  71. package/query/ScalarCriteriaNode.js +49 -0
  72. package/query/enums.d.ts +18 -0
  73. package/query/enums.js +20 -0
  74. package/query/index.d.ts +10 -0
  75. package/query/index.js +10 -0
  76. package/query/raw.d.ts +59 -0
  77. package/query/raw.js +68 -0
  78. package/schema/DatabaseSchema.d.ts +45 -0
  79. package/schema/DatabaseSchema.js +185 -0
  80. package/schema/DatabaseTable.d.ts +68 -0
  81. package/schema/DatabaseTable.js +793 -0
  82. package/schema/SchemaComparator.d.ts +58 -0
  83. package/schema/SchemaComparator.js +577 -0
  84. package/schema/SchemaHelper.d.ts +76 -0
  85. package/schema/SchemaHelper.js +545 -0
  86. package/schema/SqlSchemaGenerator.d.ts +65 -0
  87. package/schema/SqlSchemaGenerator.js +375 -0
  88. package/schema/index.d.ts +5 -0
  89. package/schema/index.js +5 -0
  90. package/typings.d.ts +272 -0
  91. package/typings.js +1 -0
@@ -0,0 +1,11 @@
1
+ import { CriteriaNode } from './CriteriaNode.js';
2
+ import type { IQueryBuilder, ICriteriaNodeProcessOptions } from '../typings.js';
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class ArrayCriteriaNode<T extends object> extends CriteriaNode<T> {
7
+ process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
8
+ unwrap(): any;
9
+ willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): any;
10
+ isStrict(): boolean;
11
+ }
@@ -0,0 +1,24 @@
1
+ import { CriteriaNode } from './CriteriaNode.js';
2
+ /**
3
+ * @internal
4
+ */
5
+ export class ArrayCriteriaNode extends CriteriaNode {
6
+ process(qb, options) {
7
+ return this.payload.map((node) => {
8
+ return node.process(qb, options);
9
+ });
10
+ }
11
+ unwrap() {
12
+ return this.payload.map((node) => {
13
+ return node.unwrap();
14
+ });
15
+ }
16
+ willAutoJoin(qb, alias, options) {
17
+ return this.payload.some((node) => {
18
+ return node.willAutoJoin(qb, alias, options);
19
+ });
20
+ }
21
+ isStrict() {
22
+ return this.strict || this.payload.some((node) => node.isStrict());
23
+ }
24
+ }
@@ -0,0 +1,29 @@
1
+ import { type EntityKey, type EntityProperty, type MetadataStorage } from '@mikro-orm/core';
2
+ import type { ICriteriaNode, ICriteriaNodeProcessOptions, IQueryBuilder } from '../typings.js';
3
+ /**
4
+ * Helper for working with deeply nested where/orderBy/having criteria. Uses composite pattern to build tree from the payload.
5
+ * Auto-joins relations and converts payload from { books: { publisher: { name: '...' } } } to { 'publisher_alias.name': '...' }
6
+ * @internal
7
+ */
8
+ export declare class CriteriaNode<T extends object> implements ICriteriaNode<T> {
9
+ protected readonly metadata: MetadataStorage;
10
+ readonly entityName: string;
11
+ readonly parent?: ICriteriaNode<T> | undefined;
12
+ readonly key?: EntityKey<T> | undefined;
13
+ readonly strict: boolean;
14
+ payload: any;
15
+ prop?: EntityProperty<T>;
16
+ index?: number;
17
+ constructor(metadata: MetadataStorage, entityName: string, parent?: ICriteriaNode<T> | undefined, key?: EntityKey<T> | undefined, validate?: boolean, strict?: boolean);
18
+ process(qb: IQueryBuilder<T>, options?: ICriteriaNodeProcessOptions): any;
19
+ unwrap(): any;
20
+ shouldInline(payload: any): boolean;
21
+ willAutoJoin(qb: IQueryBuilder<T>, alias?: string, options?: ICriteriaNodeProcessOptions): boolean;
22
+ shouldRename(payload: any): boolean;
23
+ renameFieldToPK<T>(qb: IQueryBuilder<T>, ownerAlias?: string): string;
24
+ getPath(addIndex?: boolean): string;
25
+ private isPivotJoin;
26
+ getPivotPath(path: string): string;
27
+ aliased(field: string, alias?: string): string;
28
+ isStrict(): boolean;
29
+ }
@@ -0,0 +1,121 @@
1
+ import { RawQueryFragment, ReferenceKind, Utils, inspect, } from '@mikro-orm/core';
2
+ /**
3
+ * Helper for working with deeply nested where/orderBy/having criteria. Uses composite pattern to build tree from the payload.
4
+ * Auto-joins relations and converts payload from { books: { publisher: { name: '...' } } } to { 'publisher_alias.name': '...' }
5
+ * @internal
6
+ */
7
+ export class CriteriaNode {
8
+ metadata;
9
+ entityName;
10
+ parent;
11
+ key;
12
+ strict;
13
+ payload;
14
+ prop;
15
+ index;
16
+ constructor(metadata, entityName, parent, key, validate = true, strict = false) {
17
+ this.metadata = metadata;
18
+ this.entityName = entityName;
19
+ this.parent = parent;
20
+ this.key = key;
21
+ this.strict = strict;
22
+ const meta = parent && metadata.find(parent.entityName);
23
+ if (meta && key) {
24
+ const pks = Utils.splitPrimaryKeys(key);
25
+ if (pks.length > 1) {
26
+ return;
27
+ }
28
+ for (const k of pks) {
29
+ this.prop = meta.props.find(prop => prop.name === k || (prop.fieldNames?.length === 1 && prop.fieldNames[0] === k && prop.persist !== false));
30
+ const isProp = this.prop || meta.props.find(prop => (prop.fieldNames || []).includes(k));
31
+ // do not validate if the key is prefixed or type casted (e.g. `k::text`)
32
+ if (validate && !isProp && !k.includes('.') && !k.includes('::') && !Utils.isOperator(k) && !RawQueryFragment.isKnownFragment(k)) {
33
+ throw new Error(`Trying to query by not existing property ${entityName}.${k}`);
34
+ }
35
+ }
36
+ }
37
+ }
38
+ process(qb, options) {
39
+ return this.payload;
40
+ }
41
+ unwrap() {
42
+ return this.payload;
43
+ }
44
+ shouldInline(payload) {
45
+ return false;
46
+ }
47
+ willAutoJoin(qb, alias, options) {
48
+ return false;
49
+ }
50
+ shouldRename(payload) {
51
+ const type = this.prop ? this.prop.kind : null;
52
+ const composite = this.prop?.joinColumns ? this.prop.joinColumns.length > 1 : false;
53
+ const customExpression = RawQueryFragment.isKnownFragment(this.key);
54
+ const scalar = payload === null || Utils.isPrimaryKey(payload) || payload instanceof RegExp || payload instanceof Date || customExpression;
55
+ const plainObject = Utils.isPlainObject(payload);
56
+ const keys = plainObject ? Object.keys(payload) : [];
57
+ const operator = plainObject && keys.every(k => Utils.isOperator(k, false));
58
+ if (composite) {
59
+ return true;
60
+ }
61
+ switch (type) {
62
+ case ReferenceKind.MANY_TO_ONE: return false;
63
+ case ReferenceKind.ONE_TO_ONE: return !this.prop.owner;
64
+ case ReferenceKind.ONE_TO_MANY: return scalar || operator;
65
+ case ReferenceKind.MANY_TO_MANY: return scalar || operator;
66
+ default: return false;
67
+ }
68
+ }
69
+ renameFieldToPK(qb, ownerAlias) {
70
+ const joinAlias = qb.getAliasForJoinPath(this.getPath(), { matchPopulateJoins: true });
71
+ if (!joinAlias && this.parent && [ReferenceKind.MANY_TO_ONE, ReferenceKind.ONE_TO_ONE].includes(this.prop.kind) && this.prop.owner) {
72
+ const alias = qb.getAliasForJoinPath(this.parent.getPath()) ?? ownerAlias ?? qb.alias;
73
+ return Utils.getPrimaryKeyHash(this.prop.joinColumns.map(col => `${alias}.${col}`));
74
+ }
75
+ const alias = joinAlias ?? ownerAlias ?? qb.alias;
76
+ if (this.prop.kind === ReferenceKind.MANY_TO_MANY) {
77
+ return Utils.getPrimaryKeyHash(this.prop.inverseJoinColumns.map(col => `${alias}.${col}`));
78
+ }
79
+ return Utils.getPrimaryKeyHash(this.prop.referencedColumnNames.map(col => `${alias}.${col}`));
80
+ }
81
+ getPath(addIndex = false) {
82
+ // use index on parent only if we are processing to-many relation
83
+ const addParentIndex = this.prop && [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(this.prop.kind);
84
+ const parentPath = this.parent?.getPath(addParentIndex) ?? this.entityName;
85
+ const index = addIndex && this.index != null ? `[${this.index}]` : '';
86
+ // ignore group operators to allow easier mapping (e.g. for orderBy)
87
+ const key = this.key && !['$and', '$or', '$not'].includes(this.key) ? '.' + this.key : '';
88
+ const ret = parentPath + index + key;
89
+ if (this.isPivotJoin()) {
90
+ // distinguish pivot table join from target entity join
91
+ return this.getPivotPath(ret);
92
+ }
93
+ return ret;
94
+ }
95
+ isPivotJoin() {
96
+ if (!this.key || !this.prop) {
97
+ return false;
98
+ }
99
+ const customExpression = RawQueryFragment.isKnownFragment(this.key);
100
+ const scalar = this.payload === null || Utils.isPrimaryKey(this.payload) || this.payload instanceof RegExp || this.payload instanceof Date || customExpression;
101
+ const operator = Utils.isObject(this.payload) && Object.keys(this.payload).every(k => Utils.isOperator(k, false));
102
+ return this.prop.kind === ReferenceKind.MANY_TO_MANY && (scalar || operator);
103
+ }
104
+ getPivotPath(path) {
105
+ return `${path}[pivot]`;
106
+ }
107
+ aliased(field, alias) {
108
+ return alias ? `${alias}.${field}` : field;
109
+ }
110
+ isStrict() {
111
+ return this.strict;
112
+ }
113
+ /** @ignore */
114
+ [Symbol.for('nodejs.util.inspect.custom')]() {
115
+ const o = {};
116
+ ['entityName', 'key', 'index', 'payload']
117
+ .filter(k => this[k] !== undefined)
118
+ .forEach(k => o[k] = this[k]);
119
+ return `${this.constructor.name} ${inspect(o)}`;
120
+ }
121
+ }
@@ -0,0 +1,12 @@
1
+ import { type Dictionary, type EntityKey, type EntityMetadata, type MetadataStorage } from '@mikro-orm/core';
2
+ import type { ICriteriaNode } from '../typings.js';
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class CriteriaNodeFactory {
7
+ static createNode<T extends object>(metadata: MetadataStorage, entityName: string, payload: any, parent?: ICriteriaNode<T>, key?: EntityKey<T>): ICriteriaNode<T>;
8
+ static createScalarNode<T extends object>(metadata: MetadataStorage, entityName: string, payload: any, parent?: ICriteriaNode<T>, key?: EntityKey<T>): ICriteriaNode<T>;
9
+ static createArrayNode<T extends object>(metadata: MetadataStorage, entityName: string, payload: any[], parent?: ICriteriaNode<T>, key?: EntityKey<T>): ICriteriaNode<T>;
10
+ static createObjectNode<T extends object>(metadata: MetadataStorage, entityName: string, payload: Dictionary, parent?: ICriteriaNode<T>, key?: EntityKey<T>): ICriteriaNode<T>;
11
+ static createObjectItemNode<T extends object>(metadata: MetadataStorage, entityName: string, node: ICriteriaNode<T>, payload: Dictionary, key: EntityKey<T>, meta?: EntityMetadata<T>): ICriteriaNode<T>;
12
+ }
@@ -0,0 +1,90 @@
1
+ import { GroupOperator, isRaw, JsonType, RawQueryFragment, ReferenceKind, Utils, ValidationError, } from '@mikro-orm/core';
2
+ import { ObjectCriteriaNode } from './ObjectCriteriaNode.js';
3
+ import { ArrayCriteriaNode } from './ArrayCriteriaNode.js';
4
+ import { ScalarCriteriaNode } from './ScalarCriteriaNode.js';
5
+ /**
6
+ * @internal
7
+ */
8
+ export class CriteriaNodeFactory {
9
+ static createNode(metadata, entityName, payload, parent, key) {
10
+ const customExpression = RawQueryFragment.isKnownFragment(key || '');
11
+ const scalar = Utils.isPrimaryKey(payload) || isRaw(payload) || payload instanceof RegExp || payload instanceof Date || customExpression;
12
+ if (Array.isArray(payload) && !scalar) {
13
+ return this.createArrayNode(metadata, entityName, payload, parent, key);
14
+ }
15
+ if (Utils.isPlainObject(payload) && !scalar) {
16
+ return this.createObjectNode(metadata, entityName, payload, parent, key);
17
+ }
18
+ return this.createScalarNode(metadata, entityName, payload, parent, key);
19
+ }
20
+ static createScalarNode(metadata, entityName, payload, parent, key) {
21
+ const node = new ScalarCriteriaNode(metadata, entityName, parent, key);
22
+ node.payload = payload;
23
+ return node;
24
+ }
25
+ static createArrayNode(metadata, entityName, payload, parent, key) {
26
+ const node = new ArrayCriteriaNode(metadata, entityName, parent, key);
27
+ node.payload = payload.map((item, index) => {
28
+ const n = this.createNode(metadata, entityName, item, node);
29
+ // we care about branching only for $and
30
+ if (key === '$and' && payload.length > 1) {
31
+ n.index = index;
32
+ }
33
+ return n;
34
+ });
35
+ return node;
36
+ }
37
+ static createObjectNode(metadata, entityName, payload, parent, key) {
38
+ const meta = metadata.find(entityName);
39
+ const node = new ObjectCriteriaNode(metadata, entityName, parent, key, true, payload.__strict);
40
+ node.payload = {};
41
+ for (const key of Object.keys(payload)) {
42
+ node.payload[key] = this.createObjectItemNode(metadata, entityName, node, payload, key, meta);
43
+ }
44
+ return node;
45
+ }
46
+ static createObjectItemNode(metadata, entityName, node, payload, key, meta) {
47
+ const prop = meta?.properties[key];
48
+ const childEntity = prop && prop.kind !== ReferenceKind.SCALAR ? prop.type : entityName;
49
+ const isNotEmbedded = prop?.kind !== ReferenceKind.EMBEDDED;
50
+ if (isNotEmbedded && prop?.customType instanceof JsonType) {
51
+ return this.createScalarNode(metadata, childEntity, payload[key], node, key);
52
+ }
53
+ if (prop?.kind === ReferenceKind.SCALAR && payload[key] != null && Object.keys(payload[key]).some(f => f in GroupOperator)) {
54
+ throw ValidationError.cannotUseGroupOperatorsInsideScalars(entityName, prop.name, payload);
55
+ }
56
+ if (isNotEmbedded) {
57
+ return this.createNode(metadata, childEntity, payload[key], node, key);
58
+ }
59
+ if (payload[key] == null) {
60
+ const map = Object.keys(prop.embeddedProps).reduce((oo, k) => {
61
+ oo[prop.embeddedProps[k].name] = null;
62
+ return oo;
63
+ }, {});
64
+ return this.createNode(metadata, entityName, map, node, key);
65
+ }
66
+ // array operators can be used on embedded properties
67
+ const allowedOperators = ['$contains', '$contained', '$overlap'];
68
+ const operator = Object.keys(payload[key]).some(f => Utils.isOperator(f) && !allowedOperators.includes(f));
69
+ if (operator) {
70
+ throw ValidationError.cannotUseOperatorsInsideEmbeddables(entityName, prop.name, payload);
71
+ }
72
+ const map = Object.keys(payload[key]).reduce((oo, k) => {
73
+ const embeddedProp = prop.embeddedProps[k] ?? Object.values(prop.embeddedProps).find(p => p.name === k);
74
+ if (!embeddedProp && !allowedOperators.includes(k)) {
75
+ throw ValidationError.invalidEmbeddableQuery(entityName, k, prop.type);
76
+ }
77
+ if (embeddedProp) {
78
+ oo[embeddedProp.name] = payload[key][k];
79
+ }
80
+ else if (typeof payload[key][k] === 'object') {
81
+ oo[k] = JSON.stringify(payload[key][k]);
82
+ }
83
+ else {
84
+ oo[k] = payload[key][k];
85
+ }
86
+ return oo;
87
+ }, {});
88
+ return this.createNode(metadata, entityName, map, node, key);
89
+ }
90
+ }
@@ -0,0 +1,108 @@
1
+ import { type Dictionary, LockMode, type QueryFlag, RawQueryFragment } from '@mikro-orm/core';
2
+ import { QueryType } from './enums.js';
3
+ import type { AbstractSqlPlatform } from '../AbstractSqlPlatform.js';
4
+ interface Options {
5
+ tableName?: string | RawQueryFragment;
6
+ indexHint?: string;
7
+ select?: (string | RawQueryFragment)[];
8
+ distinct?: boolean;
9
+ distinctOn?: string[];
10
+ joins?: {
11
+ sql: string;
12
+ params: unknown[];
13
+ }[];
14
+ groupBy?: (string | RawQueryFragment)[];
15
+ where?: {
16
+ sql: string;
17
+ params: unknown[];
18
+ };
19
+ having?: {
20
+ sql: string;
21
+ params: unknown[];
22
+ };
23
+ orderBy?: string;
24
+ limit?: number;
25
+ offset?: number;
26
+ data?: Dictionary;
27
+ onConflict?: OnConflictClause;
28
+ lockMode?: LockMode;
29
+ lockTables?: string[];
30
+ returning?: (string | RawQueryFragment)[];
31
+ comment?: string[];
32
+ hintComment?: string[];
33
+ flags?: Set<QueryFlag>;
34
+ wrap?: [prefix: string, suffix: string];
35
+ }
36
+ interface TableOptions {
37
+ schema?: string;
38
+ indexHint?: string;
39
+ alias?: string;
40
+ }
41
+ interface OnConflictClause {
42
+ fields: string[] | RawQueryFragment;
43
+ ignore?: boolean;
44
+ merge?: Dictionary | (string | RawQueryFragment)[];
45
+ where?: {
46
+ sql: string;
47
+ params: unknown[];
48
+ };
49
+ }
50
+ /** @internal */
51
+ export declare class NativeQueryBuilder {
52
+ protected readonly platform: AbstractSqlPlatform;
53
+ protected type?: QueryType;
54
+ protected parts: string[];
55
+ protected params: unknown[];
56
+ protected options: Options;
57
+ constructor(platform: AbstractSqlPlatform);
58
+ select(fields: string | RawQueryFragment | (string | RawQueryFragment)[]): this;
59
+ count(fields?: string | RawQueryFragment | (string | RawQueryFragment)[], distinct?: boolean): this;
60
+ into(tableName: string | RawQueryFragment | NativeQueryBuilder, options?: TableOptions): this;
61
+ from(tableName: string | RawQueryFragment | NativeQueryBuilder, options?: TableOptions): this;
62
+ where(sql: string, params: unknown[]): this;
63
+ having(sql: string, params: unknown[]): this;
64
+ groupBy(groupBy: (string | RawQueryFragment)[]): this;
65
+ join(sql: string, params: unknown[]): this;
66
+ orderBy(orderBy: string): this;
67
+ toString(): string;
68
+ compile(): {
69
+ sql: string;
70
+ params: unknown[];
71
+ };
72
+ protected addLockClause(): void;
73
+ protected addOnConflictClause(): void;
74
+ protected combineParts(): {
75
+ sql: string;
76
+ params: unknown[];
77
+ };
78
+ limit(limit: number): this;
79
+ offset(offset: number): this;
80
+ insert(data: Dictionary): this;
81
+ update(data: Dictionary): this;
82
+ delete(): this;
83
+ truncate(): this;
84
+ distinct(): this;
85
+ distinctOn(fields: string[]): this;
86
+ onConflict(options: OnConflictClause): OnConflictClause;
87
+ returning(fields: (string | RawQueryFragment)[]): this;
88
+ lockMode(lockMode: LockMode, lockTables?: string[]): this;
89
+ comment(comment: string | string[]): this;
90
+ hintComment(comment: string | string[]): this;
91
+ setFlags(flags: Set<QueryFlag>): this;
92
+ clear(clause: keyof Options): this;
93
+ wrap(prefix: string, suffix: string): this;
94
+ as(alias: string): this;
95
+ toRaw(): RawQueryFragment;
96
+ protected compileSelect(): void;
97
+ protected getFields(): string;
98
+ protected compileInsert(): void;
99
+ protected addOutputClause(type: 'inserted' | 'deleted'): void;
100
+ protected processInsertData(): string[];
101
+ protected compileUpdate(): void;
102
+ protected compileDelete(): void;
103
+ protected compileTruncate(): void;
104
+ protected addHintComment(): void;
105
+ protected getTableName(): string;
106
+ protected quote(id: string | RawQueryFragment | NativeQueryBuilder): string;
107
+ }
108
+ export {};