@mikro-orm/mssql 6.4.17-dev.1 → 6.4.17-dev.100
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/MsSqlConnection.d.ts +1 -8
- package/MsSqlConnection.js +0 -19
- package/MsSqlPlatform.d.ts +5 -1
- package/MsSqlPlatform.js +7 -1
- package/README.md +1 -2
- package/index.mjs +16 -0
- package/package.json +3 -3
package/MsSqlConnection.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { AbstractSqlConnection, type
|
|
1
|
+
import { AbstractSqlConnection, type Knex } from '@mikro-orm/knex';
|
|
2
2
|
export declare class MsSqlConnection extends AbstractSqlConnection {
|
|
3
3
|
createKnex(): void;
|
|
4
4
|
getDefaultClientUrl(): string;
|
|
5
5
|
getConnectionOptions(): Knex.MsSqlConnectionConfig;
|
|
6
|
-
begin(options?: {
|
|
7
|
-
isolationLevel?: IsolationLevel;
|
|
8
|
-
ctx?: Knex.Transaction;
|
|
9
|
-
eventBroadcaster?: TransactionEventBroadcaster;
|
|
10
|
-
}): Promise<Knex.Transaction>;
|
|
11
|
-
commit(ctx: Knex.Transaction, eventBroadcaster?: TransactionEventBroadcaster): Promise<void>;
|
|
12
|
-
rollback(ctx: Knex.Transaction, eventBroadcaster?: TransactionEventBroadcaster): Promise<void>;
|
|
13
6
|
protected transformRawResult<T>(res: any, method: 'all' | 'get' | 'run'): T;
|
|
14
7
|
}
|
package/MsSqlConnection.js
CHANGED
|
@@ -30,25 +30,6 @@ class MsSqlConnection extends knex_1.AbstractSqlConnection {
|
|
|
30
30
|
knex_1.Utils.mergeConfig(config, overrides);
|
|
31
31
|
return config;
|
|
32
32
|
}
|
|
33
|
-
async begin(options = {}) {
|
|
34
|
-
if (!options.ctx) {
|
|
35
|
-
if (options.isolationLevel) {
|
|
36
|
-
this.logQuery(`set transaction isolation level ${options.isolationLevel}`);
|
|
37
|
-
}
|
|
38
|
-
this.logQuery('begin');
|
|
39
|
-
}
|
|
40
|
-
return super.begin(options);
|
|
41
|
-
}
|
|
42
|
-
async commit(ctx, eventBroadcaster) {
|
|
43
|
-
this.logQuery('commit');
|
|
44
|
-
return super.commit(ctx, eventBroadcaster);
|
|
45
|
-
}
|
|
46
|
-
async rollback(ctx, eventBroadcaster) {
|
|
47
|
-
if (eventBroadcaster?.isTopLevel()) {
|
|
48
|
-
this.logQuery('rollback');
|
|
49
|
-
}
|
|
50
|
-
return super.rollback(ctx, eventBroadcaster);
|
|
51
|
-
}
|
|
52
33
|
transformRawResult(res, method) {
|
|
53
34
|
if (method === 'get') {
|
|
54
35
|
return res[0];
|
package/MsSqlPlatform.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare class MsSqlPlatform extends AbstractSqlPlatform {
|
|
|
9
9
|
lookupExtensions(orm: MikroORM): void;
|
|
10
10
|
/** @inheritDoc */
|
|
11
11
|
init(orm: MikroORM): void;
|
|
12
|
+
getRollbackToSavepointSQL(savepointName: string): string;
|
|
13
|
+
getSavepointSQL(savepointName: string): string;
|
|
12
14
|
usesOutputStatement(): boolean;
|
|
13
15
|
convertDateToJSValue(value: string | Date): string;
|
|
14
16
|
convertsJsonAutomatically(): boolean;
|
|
@@ -50,7 +52,9 @@ export declare class MsSqlPlatform extends AbstractSqlPlatform {
|
|
|
50
52
|
normalizePrimaryKey<T extends number | string = number | string>(data: Primary<T> | IPrimaryKey | string): T;
|
|
51
53
|
supportsMultipleCascadePaths(): boolean;
|
|
52
54
|
supportsMultipleStatements(): boolean;
|
|
53
|
-
quoteIdentifier(id: string
|
|
55
|
+
quoteIdentifier(id: string | {
|
|
56
|
+
toString: () => string;
|
|
57
|
+
}): string;
|
|
54
58
|
escape(value: any): string;
|
|
55
59
|
getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): MsSqlSchemaGenerator;
|
|
56
60
|
allowsComparingTuples(): boolean;
|
package/MsSqlPlatform.js
CHANGED
|
@@ -25,6 +25,12 @@ class MsSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
25
25
|
// do not double escape backslash inside strings
|
|
26
26
|
tsqlstring_1.default.CHARS_GLOBAL_REGEXP = /[']/g;
|
|
27
27
|
}
|
|
28
|
+
getRollbackToSavepointSQL(savepointName) {
|
|
29
|
+
return `rollback transaction ${this.quoteIdentifier(savepointName)}`;
|
|
30
|
+
}
|
|
31
|
+
getSavepointSQL(savepointName) {
|
|
32
|
+
return `save transaction ${this.quoteIdentifier(savepointName)}`;
|
|
33
|
+
}
|
|
28
34
|
usesOutputStatement() {
|
|
29
35
|
return true;
|
|
30
36
|
}
|
|
@@ -165,7 +171,7 @@ class MsSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
165
171
|
return true;
|
|
166
172
|
}
|
|
167
173
|
quoteIdentifier(id) {
|
|
168
|
-
return `[${id.replace('.', `].[`)}]`;
|
|
174
|
+
return `[${id.toString().replace('.', `].[`)}]`;
|
|
169
175
|
}
|
|
170
176
|
escape(value) {
|
|
171
177
|
if (value instanceof UnicodeStringType_1.UnicodeString) {
|
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-or
|
|
|
11
11
|
[](https://discord.gg/w8bjxFHS7X)
|
|
12
12
|
[](https://www.npmjs.com/package/@mikro-orm/core)
|
|
13
13
|
[](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)
|
|
14
|
-
[](https://codeclimate.com/github/mikro-orm/mikro-orm/maintainability)
|
|
15
14
|
[](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)
|
|
16
15
|
|
|
17
16
|
## 🤔 Unit of What?
|
|
@@ -141,7 +140,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
|
|
|
141
140
|
- [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)
|
|
142
141
|
- [Filters](https://mikro-orm.io/docs/filters)
|
|
143
142
|
- [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
|
|
144
|
-
- [
|
|
143
|
+
- [Populating relations](https://mikro-orm.io/docs/populating-relations)
|
|
145
144
|
- [Property Validation](https://mikro-orm.io/docs/property-validation)
|
|
146
145
|
- [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
|
|
147
146
|
- [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
|
package/index.mjs
CHANGED
|
@@ -67,6 +67,7 @@ export const DriverException = mod.DriverException;
|
|
|
67
67
|
export const EagerProps = mod.EagerProps;
|
|
68
68
|
export const Embeddable = mod.Embeddable;
|
|
69
69
|
export const Embedded = mod.Embedded;
|
|
70
|
+
export const EmbeddedOptionsBuilder = mod.EmbeddedOptionsBuilder;
|
|
70
71
|
export const EnsureRequestContext = mod.EnsureRequestContext;
|
|
71
72
|
export const Entity = mod.Entity;
|
|
72
73
|
export const EntityAssigner = mod.EntityAssigner;
|
|
@@ -87,6 +88,7 @@ export const EntityTransformer = mod.EntityTransformer;
|
|
|
87
88
|
export const EntityValidator = mod.EntityValidator;
|
|
88
89
|
export const Enum = mod.Enum;
|
|
89
90
|
export const EnumArrayType = mod.EnumArrayType;
|
|
91
|
+
export const EnumOptionsBuilder = mod.EnumOptionsBuilder;
|
|
90
92
|
export const EnumType = mod.EnumType;
|
|
91
93
|
export const EventManager = mod.EventManager;
|
|
92
94
|
export const EventType = mod.EventType;
|
|
@@ -118,7 +120,9 @@ export const LoadStrategy = mod.LoadStrategy;
|
|
|
118
120
|
export const LockMode = mod.LockMode;
|
|
119
121
|
export const LockWaitTimeoutException = mod.LockWaitTimeoutException;
|
|
120
122
|
export const ManyToMany = mod.ManyToMany;
|
|
123
|
+
export const ManyToManyOptionsBuilder = mod.ManyToManyOptionsBuilder;
|
|
121
124
|
export const ManyToOne = mod.ManyToOne;
|
|
125
|
+
export const ManyToOneOptionsBuilder = mod.ManyToOneOptionsBuilder;
|
|
122
126
|
export const MariaDbKnexDialect = mod.MariaDbKnexDialect;
|
|
123
127
|
export const MediumIntType = mod.MediumIntType;
|
|
124
128
|
export const MemoryCacheAdapter = mod.MemoryCacheAdapter;
|
|
@@ -153,7 +157,10 @@ export const ObjectHydrator = mod.ObjectHydrator;
|
|
|
153
157
|
export const OnInit = mod.OnInit;
|
|
154
158
|
export const OnLoad = mod.OnLoad;
|
|
155
159
|
export const OneToMany = mod.OneToMany;
|
|
160
|
+
export const OneToManyOptionsBuilder = mod.OneToManyOptionsBuilder;
|
|
161
|
+
export const OneToManyOptionsBuilderOnlyMappedBy = mod.OneToManyOptionsBuilderOnlyMappedBy;
|
|
156
162
|
export const OneToOne = mod.OneToOne;
|
|
163
|
+
export const OneToOneOptionsBuilder = mod.OneToOneOptionsBuilder;
|
|
157
164
|
export const OptimisticLockError = mod.OptimisticLockError;
|
|
158
165
|
export const OptionalProps = mod.OptionalProps;
|
|
159
166
|
export const PlainObject = mod.PlainObject;
|
|
@@ -164,6 +171,7 @@ export const PostgreSqlKnexDialect = mod.PostgreSqlKnexDialect;
|
|
|
164
171
|
export const PrimaryKey = mod.PrimaryKey;
|
|
165
172
|
export const PrimaryKeyProp = mod.PrimaryKeyProp;
|
|
166
173
|
export const Property = mod.Property;
|
|
174
|
+
export const PropertyOptionsBuilder = mod.PropertyOptionsBuilder;
|
|
167
175
|
export const QueryBuilder = mod.QueryBuilder;
|
|
168
176
|
export const QueryBuilderHelper = mod.QueryBuilderHelper;
|
|
169
177
|
export const QueryFlag = mod.QueryFlag;
|
|
@@ -177,6 +185,7 @@ export const ReadOnlyException = mod.ReadOnlyException;
|
|
|
177
185
|
export const Ref = mod.Ref;
|
|
178
186
|
export const Reference = mod.Reference;
|
|
179
187
|
export const ReferenceKind = mod.ReferenceKind;
|
|
188
|
+
export const ReferenceOptionsBuilder = mod.ReferenceOptionsBuilder;
|
|
180
189
|
export const ReflectMetadataProvider = mod.ReflectMetadataProvider;
|
|
181
190
|
export const RequestContext = mod.RequestContext;
|
|
182
191
|
export const SCALAR_TYPES = mod.SCALAR_TYPES;
|
|
@@ -204,6 +213,9 @@ export const TimeType = mod.TimeType;
|
|
|
204
213
|
export const TinyIntType = mod.TinyIntType;
|
|
205
214
|
export const TransactionContext = mod.TransactionContext;
|
|
206
215
|
export const TransactionEventBroadcaster = mod.TransactionEventBroadcaster;
|
|
216
|
+
export const TransactionManager = mod.TransactionManager;
|
|
217
|
+
export const TransactionPropagation = mod.TransactionPropagation;
|
|
218
|
+
export const TransactionStateError = mod.TransactionStateError;
|
|
207
219
|
export const Transactional = mod.Transactional;
|
|
208
220
|
export const Type = mod.Type;
|
|
209
221
|
export const Uint8ArrayType = mod.Uint8ArrayType;
|
|
@@ -226,12 +238,16 @@ export const compareBuffers = mod.compareBuffers;
|
|
|
226
238
|
export const compareObjects = mod.compareObjects;
|
|
227
239
|
export const createSqlFunction = mod.createSqlFunction;
|
|
228
240
|
export const defineConfig = mod.defineConfig;
|
|
241
|
+
export const defineEntity = mod.defineEntity;
|
|
229
242
|
export const equals = mod.equals;
|
|
243
|
+
export const expandDotPaths = mod.expandDotPaths;
|
|
244
|
+
export const getLoadingStrategy = mod.getLoadingStrategy;
|
|
230
245
|
export const getOnConflictFields = mod.getOnConflictFields;
|
|
231
246
|
export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
|
|
232
247
|
export const helper = mod.helper;
|
|
233
248
|
export const knex = mod.knex;
|
|
234
249
|
export const parseJsonSafe = mod.parseJsonSafe;
|
|
250
|
+
export const quote = mod.quote;
|
|
235
251
|
export const raw = mod.raw;
|
|
236
252
|
export const ref = mod.ref;
|
|
237
253
|
export const rel = mod.rel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mssql",
|
|
3
|
-
"version": "6.4.17-dev.
|
|
3
|
+
"version": "6.4.17-dev.100",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.4.17-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.4.17-dev.100",
|
|
62
62
|
"tedious": "19.0.0",
|
|
63
63
|
"tsqlstring": "1.0.1"
|
|
64
64
|
},
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.4.16"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.4.17-dev.
|
|
69
|
+
"@mikro-orm/core": "6.4.17-dev.100"
|
|
70
70
|
}
|
|
71
71
|
}
|