@mikro-orm/sql 7.0.4 → 7.0.5-dev.0
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 -94
- package/AbstractSqlConnection.js +238 -235
- package/AbstractSqlDriver.d.ts +155 -410
- package/AbstractSqlDriver.js +1941 -2064
- package/AbstractSqlPlatform.d.ts +73 -83
- package/AbstractSqlPlatform.js +158 -162
- package/PivotCollectionPersister.d.ts +15 -33
- package/PivotCollectionPersister.js +160 -158
- package/README.md +1 -1
- package/SqlEntityManager.d.ts +22 -67
- package/SqlEntityManager.js +38 -54
- package/SqlEntityRepository.d.ts +14 -14
- package/SqlEntityRepository.js +23 -23
- package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
- package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
- package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
- package/dialects/mysql/BaseMySqlPlatform.js +131 -134
- package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
- package/dialects/mysql/MySqlExceptionConverter.js +77 -91
- package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
- package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
- package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
- package/dialects/mysql/MySqlSchemaHelper.js +319 -327
- package/dialects/oracledb/OracleDialect.d.ts +52 -81
- package/dialects/oracledb/OracleDialect.js +149 -155
- package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
- package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
- package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +106 -109
- package/dialects/postgresql/BasePostgreSqlPlatform.js +353 -354
- package/dialects/postgresql/FullTextType.d.ts +6 -10
- package/dialects/postgresql/FullTextType.js +51 -51
- package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
- package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
- package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
- package/dialects/postgresql/PostgreSqlSchemaHelper.js +705 -733
- package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
- package/dialects/sqlite/BaseSqliteConnection.js +19 -21
- package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
- package/dialects/sqlite/NodeSqliteDialect.js +23 -23
- package/dialects/sqlite/SqliteDriver.d.ts +1 -1
- package/dialects/sqlite/SqliteDriver.js +3 -3
- package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
- package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
- package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
- package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
- package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
- package/dialects/sqlite/SqlitePlatform.js +139 -139
- package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
- package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
- package/package.json +2 -2
- package/plugin/index.d.ts +35 -42
- package/plugin/index.js +36 -43
- package/plugin/transformer.d.ts +94 -117
- package/plugin/transformer.js +881 -890
- package/query/ArrayCriteriaNode.d.ts +4 -4
- package/query/ArrayCriteriaNode.js +18 -18
- package/query/CriteriaNode.d.ts +25 -35
- package/query/CriteriaNode.js +123 -133
- package/query/CriteriaNodeFactory.d.ts +6 -49
- package/query/CriteriaNodeFactory.js +94 -97
- package/query/NativeQueryBuilder.d.ts +118 -118
- package/query/NativeQueryBuilder.js +480 -484
- package/query/ObjectCriteriaNode.d.ts +12 -12
- package/query/ObjectCriteriaNode.js +282 -298
- package/query/QueryBuilder.d.ts +905 -1557
- package/query/QueryBuilder.js +2192 -2322
- package/query/QueryBuilderHelper.d.ts +72 -153
- package/query/QueryBuilderHelper.js +1028 -1079
- package/query/ScalarCriteriaNode.d.ts +3 -3
- package/query/ScalarCriteriaNode.js +46 -53
- package/query/enums.d.ts +14 -14
- package/query/enums.js +14 -14
- package/query/raw.d.ts +6 -16
- package/query/raw.js +10 -10
- package/schema/DatabaseSchema.d.ts +50 -73
- package/schema/DatabaseSchema.js +307 -331
- package/schema/DatabaseTable.d.ts +73 -96
- package/schema/DatabaseTable.js +927 -1012
- package/schema/SchemaComparator.d.ts +66 -70
- package/schema/SchemaComparator.js +740 -766
- package/schema/SchemaHelper.d.ts +95 -109
- package/schema/SchemaHelper.js +659 -675
- package/schema/SqlSchemaGenerator.d.ts +58 -78
- package/schema/SqlSchemaGenerator.js +501 -535
- package/typings.d.ts +266 -380
|
@@ -1,104 +1,68 @@
|
|
|
1
1
|
import { type ControlledTransaction, type Dialect, Kysely } from 'kysely';
|
|
2
|
-
import {
|
|
3
|
-
type AnyEntity,
|
|
4
|
-
Connection,
|
|
5
|
-
type Dictionary,
|
|
6
|
-
type EntityData,
|
|
7
|
-
type IsolationLevel,
|
|
8
|
-
type LogContext,
|
|
9
|
-
type LoggingOptions,
|
|
10
|
-
type MaybePromise,
|
|
11
|
-
type QueryResult,
|
|
12
|
-
RawQueryFragment,
|
|
13
|
-
type Transaction,
|
|
14
|
-
type TransactionEventBroadcaster,
|
|
15
|
-
} from '@mikro-orm/core';
|
|
2
|
+
import { type AnyEntity, Connection, type Dictionary, type EntityData, type IsolationLevel, type LogContext, type LoggingOptions, type MaybePromise, type QueryResult, RawQueryFragment, type Transaction, type TransactionEventBroadcaster } from '@mikro-orm/core';
|
|
16
3
|
import type { AbstractSqlPlatform } from './AbstractSqlPlatform.js';
|
|
17
4
|
import { NativeQueryBuilder } from './query/NativeQueryBuilder.js';
|
|
18
5
|
/** Base class for SQL database connections, built on top of Kysely. */
|
|
19
6
|
export declare abstract class AbstractSqlConnection extends Connection {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
#private;
|
|
8
|
+
protected platform: AbstractSqlPlatform;
|
|
9
|
+
/** Creates a Kysely dialect instance with driver-specific configuration. */
|
|
10
|
+
abstract createKyselyDialect(overrides: Dictionary): MaybePromise<Dialect>;
|
|
11
|
+
/** Establishes the database connection and runs the onConnect hook. */
|
|
12
|
+
connect(options?: {
|
|
13
|
+
skipOnConnect?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/** Initializes the Kysely client from driver options or a user-provided Kysely instance. */
|
|
16
|
+
createKysely(): MaybePromise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
close(force?: boolean): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
isConnected(): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
checkConnection(): Promise<{
|
|
41
29
|
ok: true;
|
|
42
|
-
|
|
43
|
-
| {
|
|
30
|
+
} | {
|
|
44
31
|
ok: false;
|
|
45
32
|
reason: string;
|
|
46
33
|
error?: Error;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
eventBroadcaster?: TransactionEventBroadcaster
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ctx:
|
|
75
|
-
|
|
76
|
-
loggerContext?:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
eventBroadcaster?: TransactionEventBroadcaster,
|
|
82
|
-
loggerContext?: LogContext,
|
|
83
|
-
): Promise<void>;
|
|
84
|
-
private prepareQuery;
|
|
85
|
-
/** Executes a SQL query and returns the result based on the method: `'all'` for rows, `'get'` for single row, `'run'` for affected count. */
|
|
86
|
-
execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(
|
|
87
|
-
query: string | NativeQueryBuilder | RawQueryFragment,
|
|
88
|
-
params?: readonly unknown[],
|
|
89
|
-
method?: 'all' | 'get' | 'run',
|
|
90
|
-
ctx?: Transaction,
|
|
91
|
-
loggerContext?: LoggingOptions,
|
|
92
|
-
): Promise<T>;
|
|
93
|
-
/** Executes a SQL query and returns an async iterable that yields results row by row. */
|
|
94
|
-
stream<T extends EntityData<AnyEntity>>(
|
|
95
|
-
query: string | NativeQueryBuilder | RawQueryFragment,
|
|
96
|
-
params?: readonly unknown[],
|
|
97
|
-
ctx?: Transaction<Kysely<any>>,
|
|
98
|
-
loggerContext?: LoggingOptions,
|
|
99
|
-
): AsyncIterableIterator<T>;
|
|
100
|
-
/** @inheritDoc */
|
|
101
|
-
executeDump(dump: string): Promise<void>;
|
|
102
|
-
protected getSql(query: string, formatted: string, context?: LogContext): string;
|
|
103
|
-
protected transformRawResult<T>(res: any, method?: 'all' | 'get' | 'run'): T;
|
|
34
|
+
}>;
|
|
35
|
+
/** Returns the underlying Kysely client, creating it synchronously if needed. */
|
|
36
|
+
getClient<T = any>(): Kysely<T>;
|
|
37
|
+
/** Ensures the Kysely client is initialized, creating it asynchronously if needed. */
|
|
38
|
+
initClient(): Promise<void>;
|
|
39
|
+
/** Executes a callback within a transaction, committing on success and rolling back on error. */
|
|
40
|
+
transactional<T>(cb: (trx: Transaction<ControlledTransaction<any, any>>) => Promise<T>, options?: {
|
|
41
|
+
isolationLevel?: IsolationLevel;
|
|
42
|
+
readOnly?: boolean;
|
|
43
|
+
ctx?: ControlledTransaction<any>;
|
|
44
|
+
eventBroadcaster?: TransactionEventBroadcaster;
|
|
45
|
+
loggerContext?: LogContext;
|
|
46
|
+
}): Promise<T>;
|
|
47
|
+
/** Begins a new transaction or creates a savepoint if a transaction context already exists. */
|
|
48
|
+
begin(options?: {
|
|
49
|
+
isolationLevel?: IsolationLevel;
|
|
50
|
+
readOnly?: boolean;
|
|
51
|
+
ctx?: ControlledTransaction<any, any>;
|
|
52
|
+
eventBroadcaster?: TransactionEventBroadcaster;
|
|
53
|
+
loggerContext?: LogContext;
|
|
54
|
+
}): Promise<ControlledTransaction<any, any>>;
|
|
55
|
+
/** Commits the transaction or releases the savepoint. */
|
|
56
|
+
commit(ctx: ControlledTransaction<any, any>, eventBroadcaster?: TransactionEventBroadcaster, loggerContext?: LogContext): Promise<void>;
|
|
57
|
+
/** Rolls back the transaction or rolls back to the savepoint. */
|
|
58
|
+
rollback(ctx: ControlledTransaction<any, any>, eventBroadcaster?: TransactionEventBroadcaster, loggerContext?: LogContext): Promise<void>;
|
|
59
|
+
private prepareQuery;
|
|
60
|
+
/** Executes a SQL query and returns the result based on the method: `'all'` for rows, `'get'` for single row, `'run'` for affected count. */
|
|
61
|
+
execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(query: string | NativeQueryBuilder | RawQueryFragment, params?: readonly unknown[], method?: 'all' | 'get' | 'run', ctx?: Transaction, loggerContext?: LoggingOptions): Promise<T>;
|
|
62
|
+
/** Executes a SQL query and returns an async iterable that yields results row by row. */
|
|
63
|
+
stream<T extends EntityData<AnyEntity>>(query: string | NativeQueryBuilder | RawQueryFragment, params?: readonly unknown[], ctx?: Transaction<Kysely<any>>, loggerContext?: LoggingOptions): AsyncIterableIterator<T>;
|
|
64
|
+
/** @inheritDoc */
|
|
65
|
+
executeDump(dump: string): Promise<void>;
|
|
66
|
+
protected getSql(query: string, formatted: string, context?: LogContext): string;
|
|
67
|
+
protected transformRawResult<T>(res: any, method?: 'all' | 'get' | 'run'): T;
|
|
104
68
|
}
|