@mikro-orm/core 7.0.0-dev.1 → 7.0.0-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/EntityManager.d.ts +96 -58
- package/EntityManager.js +465 -395
- package/MikroORM.d.ts +45 -35
- package/MikroORM.js +109 -160
- package/README.md +3 -2
- package/cache/CacheAdapter.js +1 -2
- package/cache/FileCacheAdapter.d.ts +2 -2
- package/cache/FileCacheAdapter.js +20 -27
- package/cache/GeneratedCacheAdapter.d.ts +2 -3
- package/cache/GeneratedCacheAdapter.js +1 -7
- package/cache/MemoryCacheAdapter.d.ts +1 -1
- package/cache/MemoryCacheAdapter.js +1 -5
- package/cache/NullCacheAdapter.d.ts +1 -1
- package/cache/NullCacheAdapter.js +1 -5
- package/cache/index.d.ts +4 -5
- package/cache/index.js +4 -21
- package/connections/Connection.d.ts +22 -14
- package/connections/Connection.js +27 -23
- package/connections/index.d.ts +1 -1
- package/connections/index.js +1 -17
- package/drivers/DatabaseDriver.d.ts +25 -15
- package/drivers/DatabaseDriver.js +77 -64
- package/drivers/IDatabaseDriver.d.ts +40 -16
- package/drivers/IDatabaseDriver.js +1 -4
- package/drivers/index.d.ts +2 -2
- package/drivers/index.js +2 -18
- package/entity/BaseEntity.d.ts +6 -7
- package/entity/BaseEntity.js +16 -23
- package/entity/Collection.d.ts +98 -34
- package/entity/Collection.js +466 -131
- package/entity/EntityAssigner.d.ts +3 -3
- package/entity/EntityAssigner.js +67 -64
- package/entity/EntityFactory.d.ts +10 -3
- package/entity/EntityFactory.js +112 -91
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +66 -53
- package/entity/EntityIdentifier.d.ts +1 -1
- package/entity/EntityIdentifier.js +1 -5
- package/entity/EntityLoader.d.ts +8 -7
- package/entity/EntityLoader.js +161 -128
- package/entity/EntityRepository.d.ts +8 -8
- package/entity/EntityRepository.js +7 -11
- package/entity/Reference.d.ts +10 -13
- package/entity/Reference.js +64 -46
- package/entity/WrappedEntity.d.ts +12 -17
- package/entity/WrappedEntity.js +22 -31
- package/entity/defineEntity.d.ts +568 -0
- package/entity/defineEntity.js +529 -0
- package/entity/index.d.ts +14 -13
- package/entity/index.js +14 -29
- package/entity/utils.d.ts +8 -1
- package/entity/utils.js +22 -13
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +65 -0
- package/entity/wrap.d.ts +1 -1
- package/entity/wrap.js +2 -6
- package/enums.d.ts +24 -9
- package/enums.js +50 -41
- package/errors.d.ts +11 -3
- package/errors.js +42 -32
- package/events/EventManager.d.ts +5 -4
- package/events/EventManager.js +26 -22
- package/events/EventSubscriber.d.ts +8 -5
- package/events/EventSubscriber.js +1 -2
- package/events/TransactionEventBroadcaster.d.ts +3 -3
- package/events/TransactionEventBroadcaster.js +1 -5
- package/events/index.d.ts +3 -3
- package/events/index.js +3 -19
- package/exceptions.js +18 -39
- package/hydration/Hydrator.d.ts +5 -5
- package/hydration/Hydrator.js +2 -6
- package/hydration/ObjectHydrator.d.ts +7 -7
- package/hydration/ObjectHydrator.js +58 -50
- package/hydration/index.d.ts +2 -2
- package/hydration/index.js +2 -18
- package/index.d.ts +21 -21
- package/index.js +20 -46
- package/logging/DefaultLogger.d.ts +2 -2
- package/logging/DefaultLogger.js +10 -13
- package/logging/Logger.d.ts +1 -1
- package/logging/Logger.js +1 -2
- package/logging/SimpleLogger.d.ts +3 -3
- package/logging/SimpleLogger.js +2 -6
- package/logging/colors.js +1 -5
- package/logging/index.d.ts +5 -4
- package/logging/index.js +5 -20
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +16 -0
- package/metadata/EntitySchema.d.ts +14 -10
- package/metadata/EntitySchema.js +78 -64
- package/metadata/MetadataDiscovery.d.ts +11 -14
- package/metadata/MetadataDiscovery.js +278 -317
- package/metadata/MetadataProvider.d.ts +13 -4
- package/metadata/MetadataProvider.js +47 -8
- package/metadata/MetadataStorage.d.ts +2 -7
- package/metadata/MetadataStorage.js +19 -35
- package/metadata/MetadataValidator.d.ts +3 -10
- package/metadata/MetadataValidator.js +51 -64
- package/metadata/discover-entities.d.ts +5 -0
- package/metadata/discover-entities.js +40 -0
- package/metadata/index.d.ts +6 -6
- package/metadata/index.js +6 -22
- package/metadata/types.d.ts +480 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +7 -3
- package/naming-strategy/AbstractNamingStrategy.js +11 -9
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +1 -1
- package/naming-strategy/EntityCaseNamingStrategy.js +2 -6
- package/naming-strategy/MongoNamingStrategy.d.ts +1 -1
- package/naming-strategy/MongoNamingStrategy.js +2 -6
- package/naming-strategy/NamingStrategy.d.ts +12 -2
- package/naming-strategy/NamingStrategy.js +1 -2
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -1
- package/naming-strategy/UnderscoreNamingStrategy.js +2 -6
- package/naming-strategy/index.d.ts +5 -5
- package/naming-strategy/index.js +5 -21
- package/not-supported.d.ts +2 -0
- package/not-supported.js +4 -0
- package/package.json +19 -20
- package/platforms/ExceptionConverter.d.ts +2 -2
- package/platforms/ExceptionConverter.js +4 -8
- package/platforms/Platform.d.ts +15 -22
- package/platforms/Platform.js +58 -88
- package/platforms/index.d.ts +2 -2
- package/platforms/index.js +2 -18
- package/serialization/EntitySerializer.d.ts +4 -2
- package/serialization/EntitySerializer.js +64 -51
- package/serialization/EntityTransformer.d.ts +1 -1
- package/serialization/EntityTransformer.js +48 -42
- package/serialization/SerializationContext.d.ts +2 -2
- package/serialization/SerializationContext.js +24 -25
- package/serialization/index.d.ts +3 -3
- package/serialization/index.js +3 -19
- package/types/ArrayType.d.ts +3 -3
- package/types/ArrayType.js +6 -11
- package/types/BigIntType.d.ts +12 -9
- package/types/BigIntType.js +6 -6
- package/types/BlobType.d.ts +3 -4
- package/types/BlobType.js +2 -11
- package/types/BooleanType.d.ts +5 -4
- package/types/BooleanType.js +5 -6
- package/types/CharacterType.d.ts +3 -3
- package/types/CharacterType.js +2 -6
- package/types/DateTimeType.d.ts +3 -3
- package/types/DateTimeType.js +2 -6
- package/types/DateType.d.ts +3 -3
- package/types/DateType.js +2 -6
- package/types/DecimalType.d.ts +9 -7
- package/types/DecimalType.js +5 -8
- package/types/DoubleType.d.ts +3 -3
- package/types/DoubleType.js +4 -7
- package/types/EnumArrayType.d.ts +4 -4
- package/types/EnumArrayType.js +4 -10
- package/types/EnumType.d.ts +3 -3
- package/types/EnumType.js +2 -6
- package/types/FloatType.d.ts +3 -3
- package/types/FloatType.js +2 -6
- package/types/IntegerType.d.ts +3 -3
- package/types/IntegerType.js +2 -6
- package/types/IntervalType.d.ts +3 -3
- package/types/IntervalType.js +2 -6
- package/types/JsonType.d.ts +4 -4
- package/types/JsonType.js +9 -8
- package/types/MediumIntType.d.ts +3 -3
- package/types/MediumIntType.js +2 -6
- package/types/SmallIntType.d.ts +3 -3
- package/types/SmallIntType.js +2 -6
- package/types/StringType.d.ts +3 -3
- package/types/StringType.js +2 -6
- package/types/TextType.d.ts +3 -3
- package/types/TextType.js +2 -6
- package/types/TimeType.d.ts +3 -3
- package/types/TimeType.js +4 -8
- package/types/TinyIntType.d.ts +3 -3
- package/types/TinyIntType.js +3 -6
- package/types/Type.d.ts +4 -6
- package/types/Type.js +6 -10
- package/types/Uint8ArrayType.d.ts +3 -4
- package/types/Uint8ArrayType.js +3 -12
- package/types/UnknownType.d.ts +3 -3
- package/types/UnknownType.js +2 -6
- package/types/UuidType.d.ts +3 -3
- package/types/UuidType.js +2 -6
- package/types/index.d.ts +25 -25
- package/types/index.js +52 -79
- package/typings.d.ts +134 -93
- package/typings.js +67 -65
- package/unit-of-work/ChangeSet.d.ts +1 -4
- package/unit-of-work/ChangeSet.js +13 -17
- package/unit-of-work/ChangeSetComputer.d.ts +8 -9
- package/unit-of-work/ChangeSetComputer.js +36 -38
- package/unit-of-work/ChangeSetPersister.d.ts +11 -9
- package/unit-of-work/ChangeSetPersister.js +100 -65
- package/unit-of-work/CommitOrderCalculator.d.ts +1 -1
- package/unit-of-work/CommitOrderCalculator.js +6 -10
- package/unit-of-work/IdentityMap.d.ts +1 -1
- package/unit-of-work/IdentityMap.js +1 -5
- package/unit-of-work/UnitOfWork.d.ts +16 -8
- package/unit-of-work/UnitOfWork.js +266 -209
- package/unit-of-work/index.d.ts +6 -6
- package/unit-of-work/index.js +6 -22
- package/utils/AbstractSchemaGenerator.d.ts +11 -11
- package/utils/AbstractSchemaGenerator.js +21 -20
- package/utils/Configuration.d.ts +774 -224
- package/utils/Configuration.js +166 -216
- package/utils/ConfigurationLoader.d.ts +1 -53
- package/utils/ConfigurationLoader.js +1 -367
- package/utils/Cursor.d.ts +6 -9
- package/utils/Cursor.js +25 -25
- package/utils/DataloaderUtils.d.ts +18 -8
- package/utils/DataloaderUtils.js +63 -21
- package/utils/EntityComparator.d.ts +9 -5
- package/utils/EntityComparator.js +155 -108
- package/utils/NullHighlighter.d.ts +1 -1
- package/utils/NullHighlighter.js +1 -5
- package/utils/QueryHelper.d.ts +12 -4
- package/utils/QueryHelper.js +110 -53
- package/utils/RawQueryFragment.d.ts +37 -14
- package/utils/RawQueryFragment.js +50 -33
- package/utils/RequestContext.d.ts +2 -2
- package/utils/RequestContext.js +3 -7
- package/utils/TransactionContext.d.ts +1 -1
- package/utils/TransactionContext.js +4 -8
- package/utils/TransactionManager.d.ts +65 -0
- package/utils/TransactionManager.js +223 -0
- package/utils/Utils.d.ts +16 -100
- package/utils/Utils.js +114 -332
- package/utils/clone.js +7 -11
- package/utils/env-vars.d.ts +3 -0
- package/utils/env-vars.js +87 -0
- package/utils/fs-utils.d.ts +12 -0
- package/utils/fs-utils.js +97 -0
- package/utils/index.d.ts +14 -13
- package/utils/index.js +14 -29
- package/utils/upsert-utils.d.ts +8 -3
- package/utils/upsert-utils.js +57 -10
- package/decorators/Check.d.ts +0 -3
- package/decorators/Check.js +0 -16
- package/decorators/CreateRequestContext.d.ts +0 -3
- package/decorators/CreateRequestContext.js +0 -33
- package/decorators/Embeddable.d.ts +0 -8
- package/decorators/Embeddable.js +0 -14
- package/decorators/Embedded.d.ts +0 -18
- package/decorators/Embedded.js +0 -20
- package/decorators/Entity.d.ts +0 -18
- package/decorators/Entity.js +0 -16
- package/decorators/Enum.d.ts +0 -9
- package/decorators/Enum.js +0 -19
- package/decorators/Filter.d.ts +0 -2
- package/decorators/Filter.js +0 -11
- package/decorators/Formula.d.ts +0 -5
- package/decorators/Formula.js +0 -18
- package/decorators/Indexed.d.ts +0 -17
- package/decorators/Indexed.js +0 -24
- package/decorators/ManyToMany.d.ts +0 -40
- package/decorators/ManyToMany.js +0 -16
- package/decorators/ManyToOne.d.ts +0 -30
- package/decorators/ManyToOne.js +0 -16
- package/decorators/OneToMany.d.ts +0 -28
- package/decorators/OneToMany.js +0 -20
- package/decorators/OneToOne.d.ts +0 -24
- package/decorators/OneToOne.js +0 -10
- package/decorators/PrimaryKey.d.ts +0 -9
- package/decorators/PrimaryKey.js +0 -23
- package/decorators/Property.d.ts +0 -250
- package/decorators/Property.js +0 -34
- package/decorators/Transactional.d.ts +0 -13
- package/decorators/Transactional.js +0 -31
- package/decorators/hooks.d.ts +0 -16
- package/decorators/hooks.js +0 -59
- package/decorators/index.d.ts +0 -17
- package/decorators/index.js +0 -36
- package/entity/ArrayCollection.d.ts +0 -116
- package/entity/ArrayCollection.js +0 -399
- package/entity/EntityValidator.d.ts +0 -19
- package/entity/EntityValidator.js +0 -154
- package/index.mjs +0 -199
- package/metadata/ReflectMetadataProvider.d.ts +0 -8
- package/metadata/ReflectMetadataProvider.js +0 -48
- package/utils/resolveContextProvider.d.ts +0 -10
- package/utils/resolveContextProvider.js +0 -31
package/types/ArrayType.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
const errors_1 = require("../errors");
|
|
7
|
-
class ArrayType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import { ValidationError } from '../errors.js';
|
|
3
|
+
export class ArrayType extends Type {
|
|
8
4
|
toJsValue;
|
|
9
5
|
toDbValue;
|
|
10
6
|
constructor(toJsValue = i => i, toDbValue = i => i) {
|
|
@@ -19,17 +15,17 @@ class ArrayType extends Type_1.Type {
|
|
|
19
15
|
if (Array.isArray(value)) {
|
|
20
16
|
return platform.marshallArray(value.map(i => this.toDbValue(i)));
|
|
21
17
|
}
|
|
22
|
-
/*
|
|
18
|
+
/* v8 ignore next */
|
|
23
19
|
if (context?.fromQuery) {
|
|
24
20
|
return value;
|
|
25
21
|
}
|
|
26
|
-
throw
|
|
22
|
+
throw ValidationError.invalidType(ArrayType, value, 'JS');
|
|
27
23
|
}
|
|
28
24
|
convertToJSValue(value, platform) {
|
|
29
25
|
if (value == null) {
|
|
30
26
|
return value;
|
|
31
27
|
}
|
|
32
|
-
if (
|
|
28
|
+
if (typeof value === 'string') {
|
|
33
29
|
value = platform.unmarshallArray(value);
|
|
34
30
|
}
|
|
35
31
|
return value.map(i => this.toJsValue(i));
|
|
@@ -44,4 +40,3 @@ class ArrayType extends Type_1.Type {
|
|
|
44
40
|
return platform.getArrayDeclarationSQL();
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
|
-
exports.ArrayType = ArrayType;
|
package/types/BigIntType.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
/**
|
|
5
5
|
* This type will automatically convert string values returned from the database to native JS bigints (default)
|
|
6
6
|
* or numbers (safe only for values up to `Number.MAX_SAFE_INTEGER`), or strings, depending on the `mode`.
|
|
7
7
|
*/
|
|
8
|
-
export declare class BigIntType extends
|
|
9
|
-
mode?:
|
|
10
|
-
constructor(mode?:
|
|
11
|
-
convertToDatabaseValue(value:
|
|
12
|
-
convertToJSValue(value: string | bigint | null | undefined):
|
|
13
|
-
toJSON(value:
|
|
8
|
+
export declare class BigIntType<Mode extends 'bigint' | 'number' | 'string' = 'bigint'> extends Type<JSTypeByMode<Mode> | null | undefined, string | null | undefined> {
|
|
9
|
+
mode?: Mode | undefined;
|
|
10
|
+
constructor(mode?: Mode | undefined);
|
|
11
|
+
convertToDatabaseValue(value: JSTypeByMode<Mode> | null | undefined): string | null | undefined;
|
|
12
|
+
convertToJSValue(value: string | bigint | null | undefined): JSTypeByMode<Mode> | null | undefined;
|
|
13
|
+
toJSON(value: JSTypeByMode<Mode> | null | undefined): JSTypeByMode<Mode> | null | undefined;
|
|
14
14
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
15
15
|
compareAsType(): string;
|
|
16
|
+
compareValues(a: string, b: string): boolean;
|
|
16
17
|
}
|
|
18
|
+
type JSTypeByMode<Mode extends 'bigint' | 'number' | 'string'> = Mode extends 'bigint' ? bigint : Mode extends 'number' ? number : string;
|
|
19
|
+
export {};
|
package/types/BigIntType.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BigIntType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
1
|
+
import { Type } from './Type.js';
|
|
5
2
|
/**
|
|
6
3
|
* This type will automatically convert string values returned from the database to native JS bigints (default)
|
|
7
4
|
* or numbers (safe only for values up to `Number.MAX_SAFE_INTEGER`), or strings, depending on the `mode`.
|
|
8
5
|
*/
|
|
9
|
-
class BigIntType extends
|
|
6
|
+
export class BigIntType extends Type {
|
|
10
7
|
mode;
|
|
11
8
|
constructor(mode) {
|
|
12
9
|
super();
|
|
@@ -19,6 +16,7 @@ class BigIntType extends Type_1.Type {
|
|
|
19
16
|
return '' + value;
|
|
20
17
|
}
|
|
21
18
|
convertToJSValue(value) {
|
|
19
|
+
/* v8 ignore next */
|
|
22
20
|
if (value == null) {
|
|
23
21
|
return value;
|
|
24
22
|
}
|
|
@@ -44,5 +42,7 @@ class BigIntType extends Type_1.Type {
|
|
|
44
42
|
compareAsType() {
|
|
45
43
|
return this.mode ?? 'bigint';
|
|
46
44
|
}
|
|
45
|
+
compareValues(a, b) {
|
|
46
|
+
return String(a) === String(b);
|
|
47
|
+
}
|
|
47
48
|
}
|
|
48
|
-
exports.BigIntType = BigIntType;
|
package/types/BlobType.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Uint8ArrayType } from './Uint8ArrayType';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Uint8ArrayType } from './Uint8ArrayType.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class BlobType extends Uint8ArrayType {
|
|
5
5
|
convertToJSValue(value: Buffer): Buffer | null;
|
|
6
6
|
compareAsType(): string;
|
|
7
|
-
ensureComparable(): boolean;
|
|
8
7
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
9
8
|
}
|
package/types/BlobType.js
CHANGED
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BlobType = void 0;
|
|
4
|
-
const Uint8ArrayType_1 = require("./Uint8ArrayType");
|
|
5
|
-
class BlobType extends Uint8ArrayType_1.Uint8ArrayType {
|
|
1
|
+
import { Uint8ArrayType } from './Uint8ArrayType.js';
|
|
2
|
+
export class BlobType extends Uint8ArrayType {
|
|
6
3
|
convertToJSValue(value) {
|
|
7
4
|
if (value instanceof Buffer || !value) {
|
|
8
5
|
return value;
|
|
9
6
|
}
|
|
10
|
-
/* istanbul ignore else */
|
|
11
7
|
if (value.buffer instanceof Buffer) {
|
|
12
8
|
return value.buffer;
|
|
13
9
|
}
|
|
14
|
-
/* istanbul ignore next */
|
|
15
10
|
return Buffer.from(value);
|
|
16
11
|
}
|
|
17
12
|
compareAsType() {
|
|
18
13
|
return 'Buffer';
|
|
19
14
|
}
|
|
20
|
-
ensureComparable() {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
15
|
getColumnType(prop, platform) {
|
|
24
16
|
return platform.getBlobDeclarationSQL();
|
|
25
17
|
}
|
|
26
18
|
}
|
|
27
|
-
exports.BlobType = BlobType;
|
package/types/BooleanType.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
4
|
-
export declare class BooleanType extends Type<
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
|
+
export declare class BooleanType extends Type<boolean | null | undefined, boolean | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
|
7
|
+
convertToJSValue(value: boolean | null | undefined): boolean | null | undefined;
|
|
7
8
|
ensureComparable(): boolean;
|
|
8
9
|
}
|
package/types/BooleanType.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BooleanType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class BooleanType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class BooleanType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getBooleanTypeDeclarationSQL();
|
|
8
5
|
}
|
|
9
6
|
compareAsType() {
|
|
10
7
|
return 'boolean';
|
|
11
8
|
}
|
|
9
|
+
convertToJSValue(value) {
|
|
10
|
+
return Boolean(value);
|
|
11
|
+
}
|
|
12
12
|
ensureComparable() {
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.BooleanType = BooleanType;
|
package/types/CharacterType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StringType } from './StringType';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { StringType } from './StringType.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class CharacterType extends StringType {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
getDefaultLength(platform: Platform): number;
|
package/types/CharacterType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CharacterType = void 0;
|
|
4
|
-
const StringType_1 = require("./StringType");
|
|
5
|
-
class CharacterType extends StringType_1.StringType {
|
|
1
|
+
import { StringType } from './StringType.js';
|
|
2
|
+
export class CharacterType extends StringType {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getCharTypeDeclarationSQL(prop);
|
|
8
5
|
}
|
|
@@ -10,4 +7,3 @@ class CharacterType extends StringType_1.StringType {
|
|
|
10
7
|
return platform.getDefaultCharLength();
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.CharacterType = CharacterType;
|
package/types/DateTimeType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class DateTimeType extends Type<Date, string> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
package/types/DateTimeType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DateTimeType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class DateTimeType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class DateTimeType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getDateTimeTypeDeclarationSQL({ length: prop.length });
|
|
8
5
|
}
|
|
@@ -19,4 +16,3 @@ class DateTimeType extends Type_1.Type {
|
|
|
19
16
|
return platform.getDefaultDateTimeLength();
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.DateTimeType = DateTimeType;
|
package/types/DateType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class DateType extends Type<string | null | undefined, string | null | undefined> {
|
|
5
5
|
compareAsType(): string;
|
|
6
6
|
ensureComparable(): boolean;
|
package/types/DateType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DateType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class DateType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class DateType extends Type {
|
|
6
3
|
compareAsType() {
|
|
7
4
|
return 'string';
|
|
8
5
|
}
|
|
@@ -19,4 +16,3 @@ class DateType extends Type_1.Type {
|
|
|
19
16
|
return 0;
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.DateType = DateType;
|
package/types/DecimalType.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
/**
|
|
5
5
|
* Type that maps an SQL DECIMAL to a JS string or number.
|
|
6
6
|
*/
|
|
7
|
-
export declare class DecimalType extends
|
|
8
|
-
mode?:
|
|
9
|
-
constructor(mode?:
|
|
10
|
-
convertToJSValue(value: string):
|
|
7
|
+
export declare class DecimalType<Mode extends 'number' | 'string' = 'string'> extends Type<JSTypeByMode<Mode>, string> {
|
|
8
|
+
mode?: Mode | undefined;
|
|
9
|
+
constructor(mode?: Mode | undefined);
|
|
10
|
+
convertToJSValue(value: string): JSTypeByMode<Mode>;
|
|
11
11
|
compareValues(a: string, b: string): boolean;
|
|
12
12
|
private format;
|
|
13
13
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
14
14
|
compareAsType(): string;
|
|
15
15
|
}
|
|
16
|
+
type JSTypeByMode<Mode extends 'number' | 'string'> = Mode extends 'number' ? number : string;
|
|
17
|
+
export {};
|
package/types/DecimalType.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DecimalType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
1
|
+
import { Type } from './Type.js';
|
|
5
2
|
/**
|
|
6
3
|
* Type that maps an SQL DECIMAL to a JS string or number.
|
|
7
4
|
*/
|
|
8
|
-
class DecimalType extends
|
|
5
|
+
export class DecimalType extends Type {
|
|
9
6
|
mode;
|
|
10
7
|
constructor(mode) {
|
|
11
8
|
super();
|
|
12
9
|
this.mode = mode;
|
|
13
10
|
}
|
|
11
|
+
/* v8 ignore next */
|
|
14
12
|
convertToJSValue(value) {
|
|
15
13
|
if ((this.mode ?? this.prop?.runtimeType) === 'number') {
|
|
16
14
|
return +value;
|
|
17
15
|
}
|
|
18
|
-
return value;
|
|
16
|
+
return String(value);
|
|
19
17
|
}
|
|
20
18
|
compareValues(a, b) {
|
|
21
19
|
return this.format(a) === this.format(b);
|
|
22
20
|
}
|
|
23
21
|
format(val) {
|
|
24
|
-
/*
|
|
22
|
+
/* v8 ignore next */
|
|
25
23
|
if (this.prop?.scale == null) {
|
|
26
24
|
return +val;
|
|
27
25
|
}
|
|
@@ -35,4 +33,3 @@ class DecimalType extends Type_1.Type {
|
|
|
35
33
|
return this.mode ?? this.prop?.runtimeType ?? 'string';
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
exports.DecimalType = DecimalType;
|
package/types/DoubleType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
/**
|
|
5
5
|
* Type that maps an SQL DOUBLE to a JS string or number.
|
|
6
6
|
*/
|
package/types/DoubleType.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DoubleType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
1
|
+
import { Type } from './Type.js';
|
|
5
2
|
/**
|
|
6
3
|
* Type that maps an SQL DOUBLE to a JS string or number.
|
|
7
4
|
*/
|
|
8
|
-
class DoubleType extends
|
|
5
|
+
export class DoubleType extends Type {
|
|
6
|
+
/* v8 ignore next */
|
|
9
7
|
convertToJSValue(value) {
|
|
10
8
|
if (this.prop?.runtimeType === 'number') {
|
|
11
9
|
return +value;
|
|
12
10
|
}
|
|
13
|
-
return value;
|
|
11
|
+
return String(value);
|
|
14
12
|
}
|
|
15
13
|
getColumnType(prop, platform) {
|
|
16
14
|
return platform.getDoubleDeclarationSQL();
|
|
@@ -19,4 +17,3 @@ class DoubleType extends Type_1.Type {
|
|
|
19
17
|
return this.prop?.runtimeType ?? 'number';
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
exports.DoubleType = DoubleType;
|
package/types/EnumArrayType.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ArrayType } from './ArrayType';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { TransformContext } from './Type';
|
|
4
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { ArrayType } from './ArrayType.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { TransformContext } from './Type.js';
|
|
4
|
+
import type { EntityProperty } from '../typings.js';
|
|
5
5
|
export declare class EnumArrayType<T extends string | number = string> extends ArrayType<T> {
|
|
6
6
|
private readonly owner;
|
|
7
7
|
private readonly items?;
|
package/types/EnumArrayType.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EnumArrayType = void 0;
|
|
4
|
-
const node_util_1 = require("node:util");
|
|
5
|
-
const ArrayType_1 = require("./ArrayType");
|
|
6
|
-
const errors_1 = require("../errors");
|
|
1
|
+
import { ArrayType } from './ArrayType.js';
|
|
2
|
+
import { ValidationError } from '../errors.js';
|
|
7
3
|
function mapHydrator(items, hydrate) {
|
|
8
4
|
if (items && items.length > 0 && typeof items[0] === 'number') {
|
|
9
5
|
return (i) => +i;
|
|
10
6
|
}
|
|
11
7
|
return hydrate;
|
|
12
8
|
}
|
|
13
|
-
class EnumArrayType extends
|
|
9
|
+
export class EnumArrayType extends ArrayType {
|
|
14
10
|
owner;
|
|
15
11
|
items;
|
|
16
12
|
constructor(owner, items, hydrate = i => i) {
|
|
@@ -19,11 +15,10 @@ class EnumArrayType extends ArrayType_1.ArrayType {
|
|
|
19
15
|
this.items = items;
|
|
20
16
|
}
|
|
21
17
|
convertToDatabaseValue(value, platform, context) {
|
|
22
|
-
/* istanbul ignore else */
|
|
23
18
|
if (Array.isArray(value) && Array.isArray(this.items)) {
|
|
24
19
|
const invalid = value.filter(v => !this.items.includes(v));
|
|
25
20
|
if (invalid.length > 0) {
|
|
26
|
-
throw
|
|
21
|
+
throw ValidationError.invalidEnumArrayItems(this.owner, invalid);
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
return super.convertToDatabaseValue(value, platform, context);
|
|
@@ -35,4 +30,3 @@ class EnumArrayType extends ArrayType_1.ArrayType {
|
|
|
35
30
|
return super.getColumnType(prop, platform);
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
|
-
exports.EnumArrayType = EnumArrayType;
|
package/types/EnumType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class EnumType extends Type<string | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
package/types/EnumType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EnumType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class EnumType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class EnumType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
if (prop.nativeEnumName) {
|
|
8
5
|
return prop.nativeEnumName;
|
|
@@ -16,4 +13,3 @@ class EnumType extends Type_1.Type {
|
|
|
16
13
|
return false;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.EnumType = EnumType;
|
package/types/FloatType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class FloatType extends Type<number | null | undefined, number | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
package/types/FloatType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FloatType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class FloatType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class FloatType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getFloatDeclarationSQL();
|
|
8
5
|
}
|
|
@@ -13,4 +10,3 @@ class FloatType extends Type_1.Type {
|
|
|
13
10
|
return false;
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
exports.FloatType = FloatType;
|
package/types/IntegerType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class IntegerType extends Type<number | null | undefined, number | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
package/types/IntegerType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.IntegerType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class IntegerType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class IntegerType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getIntegerTypeDeclarationSQL(prop);
|
|
8
5
|
}
|
|
@@ -13,4 +10,3 @@ class IntegerType extends Type_1.Type {
|
|
|
13
10
|
return false;
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
exports.IntegerType = IntegerType;
|
package/types/IntervalType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class IntervalType extends Type<string | null | undefined, string | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
convertToJSValue(value: string | null | undefined, platform: Platform): string | null | undefined;
|
package/types/IntervalType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.IntervalType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class IntervalType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class IntervalType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getIntervalTypeDeclarationSQL(prop);
|
|
8
5
|
}
|
|
@@ -16,4 +13,3 @@ class IntervalType extends Type_1.Type {
|
|
|
16
13
|
return platform.getDefaultDateTimeLength();
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.IntervalType = IntervalType;
|
package/types/JsonType.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Type, type TransformContext } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityMetadata, EntityProperty } from '../typings';
|
|
1
|
+
import { Type, type TransformContext } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityMetadata, EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class JsonType extends Type<unknown, string | null> {
|
|
5
5
|
convertToDatabaseValue(value: unknown, platform: Platform, context?: TransformContext): string | null;
|
|
6
6
|
convertToJSValueSQL(key: string, platform: Platform): string;
|
|
7
7
|
convertToDatabaseValueSQL(key: string, platform: Platform): string;
|
|
8
|
-
convertToJSValue(value: string | unknown, platform: Platform): unknown;
|
|
8
|
+
convertToJSValue(value: string | unknown, platform: Platform, context?: TransformContext): unknown;
|
|
9
9
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
10
10
|
ensureComparable<T extends object>(meta: EntityMetadata<T>, prop: EntityProperty<T>): boolean;
|
|
11
11
|
compareAsType(): string;
|
package/types/JsonType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.JsonType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class JsonType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class JsonType extends Type {
|
|
6
3
|
convertToDatabaseValue(value, platform, context) {
|
|
7
4
|
if (value == null) {
|
|
8
5
|
return value;
|
|
@@ -15,8 +12,13 @@ class JsonType extends Type_1.Type {
|
|
|
15
12
|
convertToDatabaseValueSQL(key, platform) {
|
|
16
13
|
return key + platform.castColumn(this.prop);
|
|
17
14
|
}
|
|
18
|
-
convertToJSValue(value, platform) {
|
|
19
|
-
|
|
15
|
+
convertToJSValue(value, platform, context) {
|
|
16
|
+
const isJsonColumn = ['json', 'jsonb', platform.getJsonDeclarationSQL()].includes(this.prop.columnTypes[0]);
|
|
17
|
+
const isObjectEmbedded = this.prop.embedded && this.prop.object;
|
|
18
|
+
if ((platform.convertsJsonAutomatically() || isObjectEmbedded) && isJsonColumn && !context?.force) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
return platform.convertJsonToJSValue(value, context);
|
|
20
22
|
}
|
|
21
23
|
getColumnType(prop, platform) {
|
|
22
24
|
return platform.getJsonDeclarationSQL();
|
|
@@ -31,4 +33,3 @@ class JsonType extends Type_1.Type {
|
|
|
31
33
|
return 'any';
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
exports.JsonType = JsonType;
|
package/types/MediumIntType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Platform } from '../platforms';
|
|
2
|
-
import type { EntityProperty } from '../typings';
|
|
3
|
-
import { IntegerType } from './IntegerType';
|
|
1
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
2
|
+
import type { EntityProperty } from '../typings.js';
|
|
3
|
+
import { IntegerType } from './IntegerType.js';
|
|
4
4
|
export declare class MediumIntType extends IntegerType {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
}
|
package/types/MediumIntType.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.MediumIntType = void 0;
|
|
4
|
-
const IntegerType_1 = require("./IntegerType");
|
|
5
|
-
class MediumIntType extends IntegerType_1.IntegerType {
|
|
1
|
+
import { IntegerType } from './IntegerType.js';
|
|
2
|
+
export class MediumIntType extends IntegerType {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getMediumIntTypeDeclarationSQL(prop);
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.MediumIntType = MediumIntType;
|
package/types/SmallIntType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from './Type';
|
|
2
|
-
import type { Platform } from '../platforms';
|
|
3
|
-
import type { EntityProperty } from '../typings';
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
export declare class SmallIntType extends Type<number | null | undefined, number | null | undefined> {
|
|
5
5
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
6
|
compareAsType(): string;
|
package/types/SmallIntType.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.SmallIntType = void 0;
|
|
4
|
-
const Type_1 = require("./Type");
|
|
5
|
-
class SmallIntType extends Type_1.Type {
|
|
1
|
+
import { Type } from './Type.js';
|
|
2
|
+
export class SmallIntType extends Type {
|
|
6
3
|
getColumnType(prop, platform) {
|
|
7
4
|
return platform.getSmallIntTypeDeclarationSQL(prop);
|
|
8
5
|
}
|
|
@@ -13,4 +10,3 @@ class SmallIntType extends Type_1.Type {
|
|
|
13
10
|
return false;
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
exports.SmallIntType = SmallIntType;
|