@yandjin-mikro-orm/core 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/EntityManager.d.ts +553 -0
- package/EntityManager.js +1736 -0
- package/LICENSE +21 -0
- package/MikroORM.d.ts +102 -0
- package/MikroORM.js +258 -0
- package/README.md +383 -0
- package/cache/CacheAdapter.d.ts +40 -0
- package/cache/CacheAdapter.js +2 -0
- package/cache/FileCacheAdapter.d.ts +31 -0
- package/cache/FileCacheAdapter.js +90 -0
- package/cache/GeneratedCacheAdapter.d.ts +25 -0
- package/cache/GeneratedCacheAdapter.js +38 -0
- package/cache/MemoryCacheAdapter.d.ts +24 -0
- package/cache/MemoryCacheAdapter.js +44 -0
- package/cache/NullCacheAdapter.d.ts +19 -0
- package/cache/NullCacheAdapter.js +30 -0
- package/cache/index.d.ts +5 -0
- package/cache/index.js +21 -0
- package/connections/Connection.d.ts +85 -0
- package/connections/Connection.js +128 -0
- package/connections/index.d.ts +1 -0
- package/connections/index.js +17 -0
- package/decorators/Check.d.ts +3 -0
- package/decorators/Check.js +17 -0
- package/decorators/CreateRequestContext.d.ts +2 -0
- package/decorators/CreateRequestContext.js +31 -0
- package/decorators/Embeddable.d.ts +8 -0
- package/decorators/Embeddable.js +15 -0
- package/decorators/Embedded.d.ts +13 -0
- package/decorators/Embedded.js +21 -0
- package/decorators/EnsureRequestContext.d.ts +2 -0
- package/decorators/EnsureRequestContext.js +26 -0
- package/decorators/Entity.d.ts +18 -0
- package/decorators/Entity.js +17 -0
- package/decorators/Enum.d.ts +9 -0
- package/decorators/Enum.js +20 -0
- package/decorators/Filter.d.ts +2 -0
- package/decorators/Filter.js +12 -0
- package/decorators/Formula.d.ts +5 -0
- package/decorators/Formula.js +19 -0
- package/decorators/Indexed.d.ts +12 -0
- package/decorators/Indexed.js +25 -0
- package/decorators/ManyToMany.d.ts +21 -0
- package/decorators/ManyToMany.js +17 -0
- package/decorators/ManyToOne.d.ts +15 -0
- package/decorators/ManyToOne.js +17 -0
- package/decorators/OneToMany.d.ts +18 -0
- package/decorators/OneToMany.js +21 -0
- package/decorators/OneToOne.d.ts +12 -0
- package/decorators/OneToOne.js +11 -0
- package/decorators/PrimaryKey.d.ts +8 -0
- package/decorators/PrimaryKey.js +24 -0
- package/decorators/Property.d.ts +218 -0
- package/decorators/Property.js +35 -0
- package/decorators/Subscriber.d.ts +1 -0
- package/decorators/Subscriber.js +2 -0
- package/decorators/hooks.d.ts +16 -0
- package/decorators/hooks.js +60 -0
- package/decorators/index.d.ts +17 -0
- package/decorators/index.js +36 -0
- package/drivers/DatabaseDriver.d.ts +72 -0
- package/drivers/DatabaseDriver.js +358 -0
- package/drivers/IDatabaseDriver.d.ts +193 -0
- package/drivers/IDatabaseDriver.js +4 -0
- package/drivers/index.d.ts +2 -0
- package/drivers/index.js +18 -0
- package/entity/ArrayCollection.d.ts +113 -0
- package/entity/ArrayCollection.js +386 -0
- package/entity/BaseEntity.d.ts +22 -0
- package/entity/BaseEntity.js +47 -0
- package/entity/Collection.d.ts +104 -0
- package/entity/Collection.js +373 -0
- package/entity/EntityAssigner.d.ts +28 -0
- package/entity/EntityAssigner.js +226 -0
- package/entity/EntityFactory.d.ts +41 -0
- package/entity/EntityFactory.js +302 -0
- package/entity/EntityHelper.d.ts +29 -0
- package/entity/EntityHelper.js +250 -0
- package/entity/EntityIdentifier.d.ts +10 -0
- package/entity/EntityIdentifier.js +19 -0
- package/entity/EntityLoader.d.ts +65 -0
- package/entity/EntityLoader.js +579 -0
- package/entity/EntityRepository.d.ts +161 -0
- package/entity/EntityRepository.js +207 -0
- package/entity/EntityValidator.d.ts +19 -0
- package/entity/EntityValidator.js +152 -0
- package/entity/Reference.d.ts +89 -0
- package/entity/Reference.js +242 -0
- package/entity/WrappedEntity.d.ts +67 -0
- package/entity/WrappedEntity.js +146 -0
- package/entity/index.d.ts +13 -0
- package/entity/index.js +29 -0
- package/entity/wrap.d.ts +15 -0
- package/entity/wrap.js +26 -0
- package/enums.d.ts +160 -0
- package/enums.js +169 -0
- package/errors.d.ts +65 -0
- package/errors.js +222 -0
- package/events/EventManager.d.ts +17 -0
- package/events/EventManager.js +77 -0
- package/events/EventSubscriber.d.ts +39 -0
- package/events/EventSubscriber.js +2 -0
- package/events/TransactionEventBroadcaster.d.ts +11 -0
- package/events/TransactionEventBroadcaster.js +17 -0
- package/events/index.d.ts +3 -0
- package/events/index.js +19 -0
- package/exceptions.d.ts +104 -0
- package/exceptions.js +130 -0
- package/hydration/Hydrator.d.ts +23 -0
- package/hydration/Hydrator.js +51 -0
- package/hydration/ObjectHydrator.d.ts +24 -0
- package/hydration/ObjectHydrator.js +332 -0
- package/hydration/index.d.ts +2 -0
- package/hydration/index.js +18 -0
- package/index.d.ts +25 -0
- package/index.js +50 -0
- package/index.mjs +192 -0
- package/logging/DefaultLogger.d.ts +32 -0
- package/logging/DefaultLogger.js +90 -0
- package/logging/Logger.d.ts +56 -0
- package/logging/Logger.js +2 -0
- package/logging/SimpleLogger.d.ts +17 -0
- package/logging/SimpleLogger.js +31 -0
- package/logging/colors.d.ts +9 -0
- package/logging/colors.js +20 -0
- package/logging/index.d.ts +4 -0
- package/logging/index.js +20 -0
- package/metadata/EntitySchema.d.ts +74 -0
- package/metadata/EntitySchema.js +293 -0
- package/metadata/MetadataDiscovery.d.ts +71 -0
- package/metadata/MetadataDiscovery.js +1244 -0
- package/metadata/MetadataProvider.d.ts +11 -0
- package/metadata/MetadataProvider.js +23 -0
- package/metadata/MetadataStorage.d.ts +22 -0
- package/metadata/MetadataStorage.js +87 -0
- package/metadata/MetadataValidator.d.ts +24 -0
- package/metadata/MetadataValidator.js +213 -0
- package/metadata/ReflectMetadataProvider.d.ts +8 -0
- package/metadata/ReflectMetadataProvider.js +48 -0
- package/metadata/index.d.ts +6 -0
- package/metadata/index.js +22 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +18 -0
- package/naming-strategy/AbstractNamingStrategy.js +48 -0
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +12 -0
- package/naming-strategy/EntityCaseNamingStrategy.js +32 -0
- package/naming-strategy/MongoNamingStrategy.d.ts +9 -0
- package/naming-strategy/MongoNamingStrategy.js +25 -0
- package/naming-strategy/NamingStrategy.d.ts +52 -0
- package/naming-strategy/NamingStrategy.js +2 -0
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +10 -0
- package/naming-strategy/UnderscoreNamingStrategy.js +28 -0
- package/naming-strategy/index.d.ts +5 -0
- package/naming-strategy/index.js +21 -0
- package/package.json +70 -0
- package/platforms/ExceptionConverter.d.ts +5 -0
- package/platforms/ExceptionConverter.js +11 -0
- package/platforms/Platform.d.ts +201 -0
- package/platforms/Platform.js +452 -0
- package/platforms/index.d.ts +2 -0
- package/platforms/index.js +18 -0
- package/serialization/EntitySerializer.d.ts +34 -0
- package/serialization/EntitySerializer.js +206 -0
- package/serialization/EntityTransformer.d.ts +8 -0
- package/serialization/EntityTransformer.js +192 -0
- package/serialization/SerializationContext.d.ts +30 -0
- package/serialization/SerializationContext.js +111 -0
- package/serialization/index.d.ts +3 -0
- package/serialization/index.js +19 -0
- package/types/ArrayType.d.ts +13 -0
- package/types/ArrayType.js +47 -0
- package/types/BigIntType.d.ts +16 -0
- package/types/BigIntType.js +45 -0
- package/types/BlobType.d.ts +10 -0
- package/types/BlobType.js +27 -0
- package/types/BooleanType.d.ts +8 -0
- package/types/BooleanType.js +16 -0
- package/types/DateTimeType.d.ts +8 -0
- package/types/DateTimeType.js +16 -0
- package/types/DateType.d.ts +8 -0
- package/types/DateType.js +16 -0
- package/types/DecimalType.d.ts +11 -0
- package/types/DecimalType.js +22 -0
- package/types/DoubleType.d.ts +11 -0
- package/types/DoubleType.js +22 -0
- package/types/EnumArrayType.d.ts +9 -0
- package/types/EnumArrayType.js +32 -0
- package/types/EnumType.d.ts +8 -0
- package/types/EnumType.js +16 -0
- package/types/FloatType.d.ts +8 -0
- package/types/FloatType.js +16 -0
- package/types/IntegerType.d.ts +8 -0
- package/types/IntegerType.js +16 -0
- package/types/IntervalType.d.ts +8 -0
- package/types/IntervalType.js +16 -0
- package/types/JsonType.d.ts +13 -0
- package/types/JsonType.js +34 -0
- package/types/MediumIntType.d.ts +6 -0
- package/types/MediumIntType.js +10 -0
- package/types/SmallIntType.d.ts +8 -0
- package/types/SmallIntType.js +16 -0
- package/types/StringType.d.ts +8 -0
- package/types/StringType.js +16 -0
- package/types/TextType.d.ts +8 -0
- package/types/TextType.js +16 -0
- package/types/TimeType.d.ts +9 -0
- package/types/TimeType.js +23 -0
- package/types/TinyIntType.d.ts +8 -0
- package/types/TinyIntType.js +16 -0
- package/types/Type.d.ts +64 -0
- package/types/Type.js +84 -0
- package/types/Uint8ArrayType.d.ts +11 -0
- package/types/Uint8ArrayType.js +37 -0
- package/types/UnknownType.d.ts +7 -0
- package/types/UnknownType.js +13 -0
- package/types/UuidType.d.ts +7 -0
- package/types/UuidType.js +13 -0
- package/types/index.d.ts +75 -0
- package/types/index.js +77 -0
- package/typings.d.ts +767 -0
- package/typings.js +198 -0
- package/unit-of-work/ChangeSet.d.ts +34 -0
- package/unit-of-work/ChangeSet.js +62 -0
- package/unit-of-work/ChangeSetComputer.d.ts +26 -0
- package/unit-of-work/ChangeSetComputer.js +153 -0
- package/unit-of-work/ChangeSetPersister.d.ts +50 -0
- package/unit-of-work/ChangeSetPersister.js +361 -0
- package/unit-of-work/CommitOrderCalculator.d.ts +62 -0
- package/unit-of-work/CommitOrderCalculator.js +113 -0
- package/unit-of-work/IdentityMap.d.ts +17 -0
- package/unit-of-work/IdentityMap.js +84 -0
- package/unit-of-work/UnitOfWork.d.ts +124 -0
- package/unit-of-work/UnitOfWork.js +1013 -0
- package/unit-of-work/index.d.ts +6 -0
- package/unit-of-work/index.js +22 -0
- package/utils/AbstractSchemaGenerator.d.ts +38 -0
- package/utils/AbstractSchemaGenerator.js +101 -0
- package/utils/Configuration.d.ts +390 -0
- package/utils/Configuration.js +357 -0
- package/utils/ConfigurationLoader.d.ts +29 -0
- package/utils/ConfigurationLoader.js +282 -0
- package/utils/Cursor.d.ts +77 -0
- package/utils/Cursor.js +169 -0
- package/utils/DataloaderUtils.d.ts +43 -0
- package/utils/DataloaderUtils.js +194 -0
- package/utils/EntityComparator.d.ts +73 -0
- package/utils/EntityComparator.js +568 -0
- package/utils/NullHighlighter.d.ts +4 -0
- package/utils/NullHighlighter.js +9 -0
- package/utils/QueryHelper.d.ts +28 -0
- package/utils/QueryHelper.js +228 -0
- package/utils/RawQueryFragment.d.ts +96 -0
- package/utils/RawQueryFragment.js +188 -0
- package/utils/RequestContext.d.ts +34 -0
- package/utils/RequestContext.js +54 -0
- package/utils/TransactionContext.d.ts +19 -0
- package/utils/TransactionContext.js +34 -0
- package/utils/Utils.d.ts +274 -0
- package/utils/Utils.js +1073 -0
- package/utils/clone.d.ts +6 -0
- package/utils/clone.js +127 -0
- package/utils/index.d.ts +13 -0
- package/utils/index.js +29 -0
- package/utils/upsert-utils.d.ts +6 -0
- package/utils/upsert-utils.js +33 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseDriver = void 0;
|
|
4
|
+
const IDatabaseDriver_1 = require("./IDatabaseDriver");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const enums_1 = require("../enums");
|
|
7
|
+
const EntityManager_1 = require("../EntityManager");
|
|
8
|
+
const errors_1 = require("../errors");
|
|
9
|
+
const exceptions_1 = require("../exceptions");
|
|
10
|
+
const wrap_1 = require("../entity/wrap");
|
|
11
|
+
class DatabaseDriver {
|
|
12
|
+
config;
|
|
13
|
+
dependencies;
|
|
14
|
+
[IDatabaseDriver_1.EntityManagerType];
|
|
15
|
+
connection;
|
|
16
|
+
replicas = [];
|
|
17
|
+
platform;
|
|
18
|
+
logger;
|
|
19
|
+
comparator;
|
|
20
|
+
metadata;
|
|
21
|
+
constructor(config, dependencies) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.dependencies = dependencies;
|
|
24
|
+
this.logger = this.config.getLogger();
|
|
25
|
+
}
|
|
26
|
+
async nativeUpdateMany(entityName, where, data, options) {
|
|
27
|
+
throw new Error(`Batch updates are not supported by ${this.constructor.name} driver`);
|
|
28
|
+
}
|
|
29
|
+
createEntityManager(useContext) {
|
|
30
|
+
const EntityManagerClass = this.config.get('entityManager', EntityManager_1.EntityManager);
|
|
31
|
+
return new EntityManagerClass(this.config, this, this.metadata, useContext);
|
|
32
|
+
}
|
|
33
|
+
/* istanbul ignore next */
|
|
34
|
+
async findVirtual(entityName, where, options) {
|
|
35
|
+
throw new Error(`Virtual entities are not supported by ${this.constructor.name} driver.`);
|
|
36
|
+
}
|
|
37
|
+
/* istanbul ignore next */
|
|
38
|
+
async countVirtual(entityName, where, options) {
|
|
39
|
+
throw new Error(`Counting virtual entities is not supported by ${this.constructor.name} driver.`);
|
|
40
|
+
}
|
|
41
|
+
async aggregate(entityName, pipeline) {
|
|
42
|
+
throw new Error(`Aggregations are not supported by ${this.constructor.name} driver`);
|
|
43
|
+
}
|
|
44
|
+
async loadFromPivotTable(prop, owners, where, orderBy, ctx, options, pivotJoin) {
|
|
45
|
+
throw new Error(`${this.constructor.name} does not use pivot tables`);
|
|
46
|
+
}
|
|
47
|
+
async syncCollections(collections, options) {
|
|
48
|
+
for (const coll of collections) {
|
|
49
|
+
if (!coll.property.owner) {
|
|
50
|
+
if (coll.getSnapshot() === undefined) {
|
|
51
|
+
throw errors_1.ValidationError.cannotModifyInverseCollection(coll.owner, coll.property);
|
|
52
|
+
}
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
/* istanbul ignore next */
|
|
56
|
+
{
|
|
57
|
+
const pk = coll.property.targetMeta.primaryKeys[0];
|
|
58
|
+
const data = { [coll.property.name]: coll.getIdentifiers(pk) };
|
|
59
|
+
await this.nativeUpdate(coll.owner.constructor.name, (0, wrap_1.helper)(coll.owner).getPrimaryKey(), data, options);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
mapResult(result, meta, populate = []) {
|
|
64
|
+
if (!result || !meta) {
|
|
65
|
+
return result ?? null;
|
|
66
|
+
}
|
|
67
|
+
return this.comparator.mapResult(meta.className, result);
|
|
68
|
+
}
|
|
69
|
+
async connect() {
|
|
70
|
+
await this.connection.connect();
|
|
71
|
+
await Promise.all(this.replicas.map(replica => replica.connect()));
|
|
72
|
+
return this.connection;
|
|
73
|
+
}
|
|
74
|
+
async reconnect() {
|
|
75
|
+
await this.close(true);
|
|
76
|
+
await this.connect();
|
|
77
|
+
return this.connection;
|
|
78
|
+
}
|
|
79
|
+
getConnection(type = 'write') {
|
|
80
|
+
if (type === 'write' || this.replicas.length === 0) {
|
|
81
|
+
return this.connection;
|
|
82
|
+
}
|
|
83
|
+
const rand = utils_1.Utils.randomInt(0, this.replicas.length - 1);
|
|
84
|
+
return this.replicas[rand];
|
|
85
|
+
}
|
|
86
|
+
async close(force) {
|
|
87
|
+
await Promise.all(this.replicas.map(replica => replica.close(force)));
|
|
88
|
+
await this.connection.close(force);
|
|
89
|
+
}
|
|
90
|
+
getPlatform() {
|
|
91
|
+
return this.platform;
|
|
92
|
+
}
|
|
93
|
+
setMetadata(metadata) {
|
|
94
|
+
this.metadata = metadata;
|
|
95
|
+
this.comparator = new utils_1.EntityComparator(this.metadata, this.platform);
|
|
96
|
+
this.connection.setMetadata(metadata);
|
|
97
|
+
this.connection.setPlatform(this.platform);
|
|
98
|
+
this.replicas.forEach(replica => {
|
|
99
|
+
replica.setMetadata(metadata);
|
|
100
|
+
replica.setPlatform(this.platform);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
getMetadata() {
|
|
104
|
+
return this.metadata;
|
|
105
|
+
}
|
|
106
|
+
getDependencies() {
|
|
107
|
+
return this.dependencies;
|
|
108
|
+
}
|
|
109
|
+
processCursorOptions(meta, options, orderBy) {
|
|
110
|
+
const { first, last, before, after, overfetch } = options;
|
|
111
|
+
const limit = first || last;
|
|
112
|
+
const isLast = !first && !!last;
|
|
113
|
+
const definition = utils_1.Cursor.getDefinition(meta, orderBy);
|
|
114
|
+
const $and = [];
|
|
115
|
+
// allow POJO as well, we care only about the correct key being present
|
|
116
|
+
const isCursor = (val, key) => {
|
|
117
|
+
return !!val && typeof val === 'object' && key in val;
|
|
118
|
+
};
|
|
119
|
+
const createCursor = (val, key, inverse = false) => {
|
|
120
|
+
let def = isCursor(val, key) ? val[key] : val;
|
|
121
|
+
if (utils_1.Utils.isPlainObject(def)) {
|
|
122
|
+
def = utils_1.Cursor.for(meta, def, orderBy);
|
|
123
|
+
}
|
|
124
|
+
/* istanbul ignore next */
|
|
125
|
+
const offsets = def ? utils_1.Cursor.decode(def) : [];
|
|
126
|
+
if (definition.length === offsets.length) {
|
|
127
|
+
return this.createCursorCondition(definition, offsets, inverse);
|
|
128
|
+
}
|
|
129
|
+
/* istanbul ignore next */
|
|
130
|
+
return {};
|
|
131
|
+
};
|
|
132
|
+
if (after) {
|
|
133
|
+
$and.push(createCursor(after, 'endCursor'));
|
|
134
|
+
}
|
|
135
|
+
if (before) {
|
|
136
|
+
$and.push(createCursor(before, 'startCursor', true));
|
|
137
|
+
}
|
|
138
|
+
if (limit) {
|
|
139
|
+
options.limit = limit + (overfetch ? 1 : 0);
|
|
140
|
+
}
|
|
141
|
+
const createOrderBy = (prop, direction) => {
|
|
142
|
+
if (utils_1.Utils.isPlainObject(direction)) {
|
|
143
|
+
const value = utils_1.Utils.keys(direction).reduce((o, key) => {
|
|
144
|
+
Object.assign(o, createOrderBy(key, direction[key]));
|
|
145
|
+
return o;
|
|
146
|
+
}, {});
|
|
147
|
+
return ({ [prop]: value });
|
|
148
|
+
}
|
|
149
|
+
const desc = direction === enums_1.QueryOrderNumeric.DESC || direction.toString().toLowerCase() === 'desc';
|
|
150
|
+
const dir = utils_1.Utils.xor(desc, isLast) ? 'desc' : 'asc';
|
|
151
|
+
return ({ [prop]: dir });
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
orderBy: definition.map(([prop, direction]) => createOrderBy(prop, direction)),
|
|
155
|
+
where: ($and.length > 1 ? { $and } : { ...$and[0] }),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/* istanbul ignore next */
|
|
159
|
+
createCursorCondition(definition, offsets, inverse) {
|
|
160
|
+
const createCondition = (prop, direction, offset, eq = false) => {
|
|
161
|
+
if (utils_1.Utils.isPlainObject(direction)) {
|
|
162
|
+
const value = utils_1.Utils.keys(direction).reduce((o, key) => {
|
|
163
|
+
Object.assign(o, createCondition(key, direction[key], offset[prop][key], eq));
|
|
164
|
+
return o;
|
|
165
|
+
}, {});
|
|
166
|
+
return ({ [prop]: value });
|
|
167
|
+
}
|
|
168
|
+
const desc = direction === enums_1.QueryOrderNumeric.DESC || direction.toString().toLowerCase() === 'desc';
|
|
169
|
+
const operator = utils_1.Utils.xor(desc, inverse) ? '$lt' : '$gt';
|
|
170
|
+
return { [prop]: { [operator + (eq ? 'e' : '')]: offset } };
|
|
171
|
+
};
|
|
172
|
+
const [order, ...otherOrders] = definition;
|
|
173
|
+
const [offset, ...otherOffsets] = offsets;
|
|
174
|
+
const [prop, direction] = order;
|
|
175
|
+
if (!otherOrders.length) {
|
|
176
|
+
return createCondition(prop, direction, offset);
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
...createCondition(prop, direction, offset, true),
|
|
180
|
+
$or: [
|
|
181
|
+
createCondition(prop, direction, offset),
|
|
182
|
+
this.createCursorCondition(otherOrders, otherOffsets, inverse),
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/** @internal */
|
|
187
|
+
mapDataToFieldNames(data, stringifyJsonArrays, properties, convertCustomTypes, object) {
|
|
188
|
+
if (!properties || data == null) {
|
|
189
|
+
return data;
|
|
190
|
+
}
|
|
191
|
+
data = Object.assign({}, data); // copy first
|
|
192
|
+
Object.keys(data).forEach(k => {
|
|
193
|
+
const prop = properties[k];
|
|
194
|
+
if (!prop) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (prop.embeddedProps && !prop.object && !object) {
|
|
198
|
+
const copy = data[k];
|
|
199
|
+
delete data[k];
|
|
200
|
+
Object.assign(data, this.mapDataToFieldNames(copy, stringifyJsonArrays, prop.embeddedProps, convertCustomTypes));
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (prop.embeddedProps && (object || prop.object)) {
|
|
204
|
+
const copy = data[k];
|
|
205
|
+
delete data[k];
|
|
206
|
+
if (prop.array) {
|
|
207
|
+
data[prop.fieldNames[0]] = copy.map((item) => this.mapDataToFieldNames(item, stringifyJsonArrays, prop.embeddedProps, convertCustomTypes, true));
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
data[prop.fieldNames[0]] = this.mapDataToFieldNames(copy, stringifyJsonArrays, prop.embeddedProps, convertCustomTypes, true);
|
|
211
|
+
}
|
|
212
|
+
if (stringifyJsonArrays && prop.array) {
|
|
213
|
+
data[prop.fieldNames[0]] = this.platform.convertJsonToDatabaseValue(data[prop.fieldNames[0]]);
|
|
214
|
+
}
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (prop.joinColumns && Array.isArray(data[k])) {
|
|
218
|
+
const copy = utils_1.Utils.flatten(data[k]);
|
|
219
|
+
delete data[k];
|
|
220
|
+
prop.joinColumns.forEach((joinColumn, idx) => data[joinColumn] = copy[idx]);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (prop.customType && convertCustomTypes && !this.platform.isRaw(data[k])) {
|
|
224
|
+
data[k] = prop.customType.convertToDatabaseValue(data[k], this.platform, { fromQuery: true, key: k, mode: 'query-data' });
|
|
225
|
+
}
|
|
226
|
+
if (prop.hasConvertToDatabaseValueSQL && !prop.object && !this.platform.isRaw(data[k])) {
|
|
227
|
+
const quoted = this.platform.quoteValue(data[k]);
|
|
228
|
+
const sql = prop.customType.convertToDatabaseValueSQL(quoted, this.platform);
|
|
229
|
+
data[k] = (0, utils_1.raw)(sql.replace(/\?/g, '\\?'));
|
|
230
|
+
}
|
|
231
|
+
/* istanbul ignore next */
|
|
232
|
+
if (!prop.customType && (Array.isArray(data[k]) || utils_1.Utils.isPlainObject(data[k]))) {
|
|
233
|
+
data[k] = JSON.stringify(data[k]);
|
|
234
|
+
}
|
|
235
|
+
if (prop.fieldNames) {
|
|
236
|
+
utils_1.Utils.renameKey(data, k, prop.fieldNames[0]);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
241
|
+
inlineEmbeddables(meta, data, where) {
|
|
242
|
+
/* istanbul ignore next */
|
|
243
|
+
if (data == null) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
utils_1.Utils.keys(data).forEach(k => {
|
|
247
|
+
if (utils_1.Utils.isOperator(k)) {
|
|
248
|
+
utils_1.Utils.asArray(data[k]).forEach(payload => this.inlineEmbeddables(meta, payload, where));
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
meta.props.forEach(prop => {
|
|
252
|
+
if (prop.kind === enums_1.ReferenceKind.EMBEDDED && prop.object && !where && utils_1.Utils.isObject(data[prop.name])) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (prop.kind === enums_1.ReferenceKind.EMBEDDED && utils_1.Utils.isObject(data[prop.name])) {
|
|
256
|
+
const props = prop.embeddedProps;
|
|
257
|
+
let unknownProp = false;
|
|
258
|
+
Object.keys(data[prop.name]).forEach(kk => {
|
|
259
|
+
// explicitly allow `$exists`, `$eq` and `$ne` operators here as they can't be misused this way
|
|
260
|
+
const operator = Object.keys(data[prop.name]).some(f => utils_1.Utils.isOperator(f) && !['$exists', '$ne', '$eq'].includes(f));
|
|
261
|
+
if (operator) {
|
|
262
|
+
throw errors_1.ValidationError.cannotUseOperatorsInsideEmbeddables(meta.className, prop.name, data);
|
|
263
|
+
}
|
|
264
|
+
if (prop.object && where) {
|
|
265
|
+
const inline = (payload, sub, path) => {
|
|
266
|
+
if (sub.kind === enums_1.ReferenceKind.EMBEDDED && utils_1.Utils.isObject(payload[sub.embedded[1]])) {
|
|
267
|
+
return Object.keys(payload[sub.embedded[1]]).forEach(kkk => {
|
|
268
|
+
if (!sub.embeddedProps[kkk]) {
|
|
269
|
+
throw errors_1.ValidationError.invalidEmbeddableQuery(meta.className, kkk, sub.type);
|
|
270
|
+
}
|
|
271
|
+
inline(payload[sub.embedded[1]], sub.embeddedProps[kkk], [...path, sub.embedded[1]]);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
data[`${path.join('.')}.${sub.embedded[1]}`] = payload[sub.embedded[1]];
|
|
275
|
+
};
|
|
276
|
+
const parentPropName = kk.substring(0, kk.indexOf('.'));
|
|
277
|
+
// we might be using some native JSON operator, e.g. with mongodb's `$geoWithin` or `$exists`
|
|
278
|
+
if (props[kk]) {
|
|
279
|
+
/* istanbul ignore next */
|
|
280
|
+
inline(data[prop.name], props[kk] || props[parentPropName], [prop.name]);
|
|
281
|
+
}
|
|
282
|
+
else if (props[parentPropName]) {
|
|
283
|
+
data[`${prop.name}.${kk}`] = data[prop.name][kk];
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
unknownProp = true;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
else if (props[kk]) {
|
|
290
|
+
data[props[kk].name] = data[prop.name][props[kk].embedded[1]];
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
throw errors_1.ValidationError.invalidEmbeddableQuery(meta.className, kk, prop.type);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
if (!unknownProp) {
|
|
297
|
+
delete data[prop.name];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
getPrimaryKeyFields(entityName) {
|
|
303
|
+
const meta = this.metadata.find(entityName);
|
|
304
|
+
return meta ? utils_1.Utils.flatten(meta.getPrimaryProps().map(pk => pk.fieldNames)) : [this.config.getNamingStrategy().referenceColumnName()];
|
|
305
|
+
}
|
|
306
|
+
createReplicas(cb) {
|
|
307
|
+
const replicas = this.config.get('replicas', []);
|
|
308
|
+
const ret = [];
|
|
309
|
+
const props = ['dbName', 'clientUrl', 'host', 'port', 'user', 'password', 'multipleStatements', 'pool', 'name'];
|
|
310
|
+
replicas.forEach((conf) => {
|
|
311
|
+
props.forEach(prop => conf[prop] = prop in conf ? conf[prop] : this.config.get(prop));
|
|
312
|
+
ret.push(cb(conf));
|
|
313
|
+
});
|
|
314
|
+
return ret;
|
|
315
|
+
}
|
|
316
|
+
async lockPessimistic(entity, options) {
|
|
317
|
+
throw new Error(`Pessimistic locks are not supported by ${this.constructor.name} driver`);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* @inheritDoc
|
|
321
|
+
*/
|
|
322
|
+
convertException(exception) {
|
|
323
|
+
if (exception instanceof exceptions_1.DriverException) {
|
|
324
|
+
return exception;
|
|
325
|
+
}
|
|
326
|
+
return this.platform.getExceptionConverter().convertException(exception);
|
|
327
|
+
}
|
|
328
|
+
rethrow(promise) {
|
|
329
|
+
return promise.catch(e => {
|
|
330
|
+
throw this.convertException(e);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @internal
|
|
335
|
+
*/
|
|
336
|
+
getTableName(meta, options) {
|
|
337
|
+
const tableName = this.platform.quoteIdentifier(meta.tableName);
|
|
338
|
+
const schema = this.getSchemaName(meta, options);
|
|
339
|
+
if (schema) {
|
|
340
|
+
return this.platform.quoteIdentifier(schema) + '.' + tableName;
|
|
341
|
+
}
|
|
342
|
+
return tableName;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* @internal
|
|
346
|
+
*/
|
|
347
|
+
getSchemaName(meta, options) {
|
|
348
|
+
if (meta?.schema && meta.schema !== '*') {
|
|
349
|
+
return meta.schema;
|
|
350
|
+
}
|
|
351
|
+
if (options?.schema === '*') {
|
|
352
|
+
return this.config.get('schema');
|
|
353
|
+
}
|
|
354
|
+
const schemaName = meta?.schema === '*' ? this.config.get('schema') : meta?.schema;
|
|
355
|
+
return options?.schema ?? schemaName ?? this.config.get('schema');
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
exports.DatabaseDriver = DatabaseDriver;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { ConnectionType, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary, QBFilterQuery, IPrimaryKey, PopulateOptions, EntityDictionary, AutoPath, ObjectQuery, FilterObject, Populate } from '../typings';
|
|
2
|
+
import type { Connection, QueryResult, Transaction } from '../connections';
|
|
3
|
+
import type { FlushMode, LockMode, QueryOrderMap, QueryFlag, LoadStrategy, PopulateHint } from '../enums';
|
|
4
|
+
import type { Platform } from '../platforms';
|
|
5
|
+
import type { MetadataStorage } from '../metadata';
|
|
6
|
+
import type { Collection } from '../entity/Collection';
|
|
7
|
+
import type { EntityManager } from '../EntityManager';
|
|
8
|
+
import type { DriverException } from '../exceptions';
|
|
9
|
+
import type { Configuration } from '../utils/Configuration';
|
|
10
|
+
import type { LoggingOptions, LogContext } from '../logging';
|
|
11
|
+
export declare const EntityManagerType: unique symbol;
|
|
12
|
+
export interface IDatabaseDriver<C extends Connection = Connection> {
|
|
13
|
+
[EntityManagerType]: EntityManager<this>;
|
|
14
|
+
readonly config: Configuration;
|
|
15
|
+
createEntityManager<D extends IDatabaseDriver = IDatabaseDriver>(useContext?: boolean): D[typeof EntityManagerType];
|
|
16
|
+
connect(): Promise<C>;
|
|
17
|
+
close(force?: boolean): Promise<void>;
|
|
18
|
+
reconnect(): Promise<C>;
|
|
19
|
+
getConnection(type?: ConnectionType): C;
|
|
20
|
+
/**
|
|
21
|
+
* Finds selection of entities
|
|
22
|
+
*/
|
|
23
|
+
find<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName: string, where: FilterQuery<T>, options?: FindOptions<T, P, F, E>): Promise<EntityData<T>[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Finds single entity (table row, document)
|
|
26
|
+
*/
|
|
27
|
+
findOne<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName: string, where: FilterQuery<T>, options?: FindOneOptions<T, P, F, E>): Promise<EntityData<T> | null>;
|
|
28
|
+
findVirtual<T extends object>(entityName: string, where: FilterQuery<T>, options: FindOptions<T, any, any, any>): Promise<EntityData<T>[]>;
|
|
29
|
+
nativeInsert<T extends object>(entityName: string, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
30
|
+
nativeInsertMany<T extends object>(entityName: string, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
31
|
+
nativeUpdate<T extends object>(entityName: string, where: FilterQuery<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
32
|
+
nativeUpdateMany<T extends object>(entityName: string, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
33
|
+
nativeDelete<T extends object>(entityName: string, where: FilterQuery<T>, options?: NativeDeleteOptions<T>): Promise<QueryResult<T>>;
|
|
34
|
+
syncCollections<T extends object, O extends object>(collections: Iterable<Collection<T, O>>, options?: DriverMethodOptions): Promise<void>;
|
|
35
|
+
count<T extends object, P extends string = never>(entityName: string, where: FilterQuery<T>, options?: CountOptions<T, P>): Promise<number>;
|
|
36
|
+
aggregate(entityName: string, pipeline: any[]): Promise<any[]>;
|
|
37
|
+
mapResult<T extends object>(result: EntityDictionary<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[]): EntityData<T> | null;
|
|
38
|
+
/**
|
|
39
|
+
* When driver uses pivot tables for M:N, this method will load identifiers for given collections from them
|
|
40
|
+
*/
|
|
41
|
+
loadFromPivotTable<T extends object, O extends object>(prop: EntityProperty, owners: Primary<O>[][], where?: FilterQuery<T>, orderBy?: OrderDefinition<T>, ctx?: Transaction, options?: FindOptions<T, any, any, any>, pivotJoin?: boolean): Promise<Dictionary<T[]>>;
|
|
42
|
+
getPlatform(): Platform;
|
|
43
|
+
setMetadata(metadata: MetadataStorage): void;
|
|
44
|
+
getMetadata(): MetadataStorage;
|
|
45
|
+
/**
|
|
46
|
+
* Returns name of the underlying database dependencies (e.g. `mongodb` or `mysql2`)
|
|
47
|
+
* for SQL drivers it also returns `knex` in the array as connectors are not used directly there
|
|
48
|
+
*/
|
|
49
|
+
getDependencies(): string[];
|
|
50
|
+
lockPessimistic<T extends object>(entity: T, options: LockOptions): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Converts native db errors to standardized driver exceptions
|
|
53
|
+
*/
|
|
54
|
+
convertException(exception: Error): DriverException;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
getSchemaName(meta?: EntityMetadata, options?: {
|
|
59
|
+
schema?: string;
|
|
60
|
+
}): string | undefined;
|
|
61
|
+
}
|
|
62
|
+
export type EntityField<T, P extends string = '*'> = keyof T | '*' | AutoPath<T, P, '*'>;
|
|
63
|
+
export type OrderDefinition<T> = (QueryOrderMap<T> & {
|
|
64
|
+
0?: never;
|
|
65
|
+
}) | QueryOrderMap<T>[];
|
|
66
|
+
export interface FindAllOptions<T, P extends string = never, F extends string = '*', E extends string = never> extends FindOptions<T, P, F, E> {
|
|
67
|
+
where?: FilterQuery<T>;
|
|
68
|
+
}
|
|
69
|
+
export type FilterOptions = Dictionary<boolean | Dictionary> | string[] | boolean;
|
|
70
|
+
export interface FindOptions<Entity, Hint extends string = never, Fields extends string = '*', Excludes extends string = never> {
|
|
71
|
+
populate?: Populate<Entity, Hint>;
|
|
72
|
+
populateWhere?: ObjectQuery<Entity> | PopulateHint | `${PopulateHint}`;
|
|
73
|
+
populateOrderBy?: OrderDefinition<Entity>;
|
|
74
|
+
fields?: readonly AutoPath<Entity, Fields, '*'>[];
|
|
75
|
+
exclude?: readonly AutoPath<Entity, Excludes>[];
|
|
76
|
+
orderBy?: OrderDefinition<Entity>;
|
|
77
|
+
cache?: boolean | number | [string, number];
|
|
78
|
+
limit?: number;
|
|
79
|
+
offset?: number;
|
|
80
|
+
/** Fetch items `before` this cursor. */
|
|
81
|
+
before?: string | {
|
|
82
|
+
startCursor: string | null;
|
|
83
|
+
} | FilterObject<Entity>;
|
|
84
|
+
/** Fetch items `after` this cursor. */
|
|
85
|
+
after?: string | {
|
|
86
|
+
endCursor: string | null;
|
|
87
|
+
} | FilterObject<Entity>;
|
|
88
|
+
/** Fetch `first` N items. */
|
|
89
|
+
first?: number;
|
|
90
|
+
/** Fetch `last` N items. */
|
|
91
|
+
last?: number;
|
|
92
|
+
/** Fetch one more item than `first`/`last`, enabled automatically in `em.findByCursor` to check if there is a next page. */
|
|
93
|
+
overfetch?: boolean;
|
|
94
|
+
refresh?: boolean;
|
|
95
|
+
convertCustomTypes?: boolean;
|
|
96
|
+
disableIdentityMap?: boolean;
|
|
97
|
+
schema?: string;
|
|
98
|
+
flags?: QueryFlag[];
|
|
99
|
+
/** sql only */
|
|
100
|
+
groupBy?: string | string[];
|
|
101
|
+
having?: QBFilterQuery<Entity>;
|
|
102
|
+
/** sql only */
|
|
103
|
+
strategy?: LoadStrategy | `${LoadStrategy}`;
|
|
104
|
+
flushMode?: FlushMode | `${FlushMode}`;
|
|
105
|
+
filters?: FilterOptions;
|
|
106
|
+
/** sql only */
|
|
107
|
+
lockMode?: Exclude<LockMode, LockMode.OPTIMISTIC>;
|
|
108
|
+
/** sql only */
|
|
109
|
+
lockTableAliases?: string[];
|
|
110
|
+
ctx?: Transaction;
|
|
111
|
+
connectionType?: ConnectionType;
|
|
112
|
+
/** sql only */
|
|
113
|
+
indexHint?: string;
|
|
114
|
+
/** sql only */
|
|
115
|
+
comments?: string | string[];
|
|
116
|
+
/** sql only */
|
|
117
|
+
hintComments?: string | string[];
|
|
118
|
+
loggerContext?: LogContext;
|
|
119
|
+
logging?: LoggingOptions;
|
|
120
|
+
}
|
|
121
|
+
export interface FindByCursorOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never> extends Omit<FindOptions<T, P, F, E>, 'limit' | 'offset'> {
|
|
122
|
+
}
|
|
123
|
+
export interface FindOneOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never> extends Omit<FindOptions<T, P, F, E>, 'limit' | 'lockMode'> {
|
|
124
|
+
lockMode?: LockMode;
|
|
125
|
+
lockVersion?: number | Date;
|
|
126
|
+
}
|
|
127
|
+
export interface FindOneOrFailOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never> extends FindOneOptions<T, P, F, E> {
|
|
128
|
+
failHandler?: (entityName: string, where: Dictionary | IPrimaryKey | any) => Error;
|
|
129
|
+
strict?: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface NativeInsertUpdateOptions<T> {
|
|
132
|
+
convertCustomTypes?: boolean;
|
|
133
|
+
ctx?: Transaction;
|
|
134
|
+
schema?: string;
|
|
135
|
+
/** `nativeUpdate()` only option */
|
|
136
|
+
upsert?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface NativeInsertUpdateManyOptions<T> extends NativeInsertUpdateOptions<T> {
|
|
139
|
+
processCollections?: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface UpsertOptions<Entity> extends Omit<NativeInsertUpdateOptions<Entity>, 'upsert'> {
|
|
142
|
+
onConflictFields?: (keyof Entity)[];
|
|
143
|
+
onConflictAction?: 'ignore' | 'merge';
|
|
144
|
+
onConflictMergeFields?: (keyof Entity)[];
|
|
145
|
+
onConflictExcludeFields?: (keyof Entity)[];
|
|
146
|
+
}
|
|
147
|
+
export interface UpsertManyOptions<Entity> extends UpsertOptions<Entity> {
|
|
148
|
+
batchSize?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface CountOptions<T extends object, P extends string = never> {
|
|
151
|
+
filters?: FilterOptions;
|
|
152
|
+
schema?: string;
|
|
153
|
+
groupBy?: string | readonly string[];
|
|
154
|
+
having?: QBFilterQuery<T>;
|
|
155
|
+
cache?: boolean | number | [string, number];
|
|
156
|
+
populate?: Populate<T, P>;
|
|
157
|
+
ctx?: Transaction;
|
|
158
|
+
connectionType?: ConnectionType;
|
|
159
|
+
/** sql only */
|
|
160
|
+
indexHint?: string;
|
|
161
|
+
/** sql only */
|
|
162
|
+
comments?: string | string[];
|
|
163
|
+
/** sql only */
|
|
164
|
+
hintComments?: string | string[];
|
|
165
|
+
loggerContext?: LogContext;
|
|
166
|
+
logging?: LoggingOptions;
|
|
167
|
+
}
|
|
168
|
+
export interface UpdateOptions<T> {
|
|
169
|
+
filters?: FilterOptions;
|
|
170
|
+
schema?: string;
|
|
171
|
+
ctx?: Transaction;
|
|
172
|
+
}
|
|
173
|
+
export interface DeleteOptions<T> extends DriverMethodOptions {
|
|
174
|
+
filters?: FilterOptions;
|
|
175
|
+
}
|
|
176
|
+
export interface NativeDeleteOptions<T> extends DriverMethodOptions {
|
|
177
|
+
filters?: FilterOptions;
|
|
178
|
+
}
|
|
179
|
+
export interface LockOptions extends DriverMethodOptions {
|
|
180
|
+
lockMode?: LockMode;
|
|
181
|
+
lockVersion?: number | Date;
|
|
182
|
+
lockTableAliases?: string[];
|
|
183
|
+
logging?: LoggingOptions;
|
|
184
|
+
}
|
|
185
|
+
export interface DriverMethodOptions {
|
|
186
|
+
ctx?: Transaction;
|
|
187
|
+
schema?: string;
|
|
188
|
+
}
|
|
189
|
+
export interface GetReferenceOptions {
|
|
190
|
+
wrapped?: boolean;
|
|
191
|
+
convertCustomTypes?: boolean;
|
|
192
|
+
schema?: string;
|
|
193
|
+
}
|
package/drivers/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IDatabaseDriver"), exports);
|
|
18
|
+
__exportStar(require("./DatabaseDriver"), exports);
|