@mikro-orm/core 6.2.10-dev.75 → 6.2.10-dev.76
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/index.mjs +1 -0
- package/package.json +2 -2
- package/platforms/Platform.d.ts +4 -0
- package/platforms/Platform.js +8 -0
- package/types/CharacterType.d.ts +7 -0
- package/types/CharacterType.js +13 -0
- package/types/index.d.ts +19 -16
- package/types/index.js +34 -31
package/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ export const ChangeSet = mod.ChangeSet;
|
|
|
25
25
|
export const ChangeSetComputer = mod.ChangeSetComputer;
|
|
26
26
|
export const ChangeSetPersister = mod.ChangeSetPersister;
|
|
27
27
|
export const ChangeSetType = mod.ChangeSetType;
|
|
28
|
+
export const CharacterType = mod.CharacterType;
|
|
28
29
|
export const Check = mod.Check;
|
|
29
30
|
export const CheckConstraintViolationException = mod.CheckConstraintViolationException;
|
|
30
31
|
export const Collection = mod.Collection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.2.10-dev.
|
|
3
|
+
"version": "6.2.10-dev.76",
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.2.10-dev.
|
|
67
|
+
"mikro-orm": "6.2.10-dev.76",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/platforms/Platform.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare abstract class Platform {
|
|
|
59
59
|
}): string;
|
|
60
60
|
getDefaultDateTimeLength(): number;
|
|
61
61
|
getDefaultVarcharLength(): number;
|
|
62
|
+
getDefaultCharLength(): number;
|
|
62
63
|
getDateTypeDeclarationSQL(length?: number): string;
|
|
63
64
|
getTimeTypeDeclarationSQL(length?: number): string;
|
|
64
65
|
getRegExpOperator(val?: unknown, flags?: string): string;
|
|
@@ -99,6 +100,9 @@ export declare abstract class Platform {
|
|
|
99
100
|
unsigned?: boolean;
|
|
100
101
|
autoincrement?: boolean;
|
|
101
102
|
}): string;
|
|
103
|
+
getCharTypeDeclarationSQL(column: {
|
|
104
|
+
length?: number;
|
|
105
|
+
}): string;
|
|
102
106
|
getVarcharTypeDeclarationSQL(column: {
|
|
103
107
|
length?: number;
|
|
104
108
|
}): string;
|
package/platforms/Platform.js
CHANGED
|
@@ -99,6 +99,9 @@ class Platform {
|
|
|
99
99
|
getDefaultVarcharLength() {
|
|
100
100
|
return 255;
|
|
101
101
|
}
|
|
102
|
+
getDefaultCharLength() {
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
102
105
|
getDateTypeDeclarationSQL(length) {
|
|
103
106
|
return 'date' + (length ? `(${length})` : '');
|
|
104
107
|
}
|
|
@@ -153,6 +156,9 @@ class Platform {
|
|
|
153
156
|
getBigIntTypeDeclarationSQL(column) {
|
|
154
157
|
return 'bigint';
|
|
155
158
|
}
|
|
159
|
+
getCharTypeDeclarationSQL(column) {
|
|
160
|
+
return `char(${column.length ?? this.getDefaultCharLength()})`;
|
|
161
|
+
}
|
|
156
162
|
getVarcharTypeDeclarationSQL(column) {
|
|
157
163
|
return `varchar(${column.length ?? this.getDefaultVarcharLength()})`;
|
|
158
164
|
}
|
|
@@ -195,6 +201,8 @@ class Platform {
|
|
|
195
201
|
return types_1.Type.getType(types_1.ArrayType);
|
|
196
202
|
}
|
|
197
203
|
switch (this.extractSimpleType(type)) {
|
|
204
|
+
case 'character':
|
|
205
|
+
case 'char': return types_1.Type.getType(types_1.CharacterType);
|
|
198
206
|
case 'string':
|
|
199
207
|
case 'varchar': return types_1.Type.getType(types_1.StringType);
|
|
200
208
|
case 'interval': return types_1.Type.getType(types_1.IntervalType);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StringType } from './StringType';
|
|
2
|
+
import type { Platform } from '../platforms';
|
|
3
|
+
import type { EntityProperty } from '../typings';
|
|
4
|
+
export declare class CharacterType extends StringType {
|
|
5
|
+
getColumnType(prop: EntityProperty, platform: Platform): string;
|
|
6
|
+
getDefaultLength(platform: Platform): number;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CharacterType = void 0;
|
|
4
|
+
const StringType_1 = require("./StringType");
|
|
5
|
+
class CharacterType extends StringType_1.StringType {
|
|
6
|
+
getColumnType(prop, platform) {
|
|
7
|
+
return platform.getCharTypeDeclarationSQL(prop);
|
|
8
|
+
}
|
|
9
|
+
getDefaultLength(platform) {
|
|
10
|
+
return platform.getDefaultCharLength();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.CharacterType = CharacterType;
|
package/types/index.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DateType } from './DateType';
|
|
3
|
-
import { TimeType } from './TimeType';
|
|
4
|
-
import { DateTimeType } from './DateTimeType';
|
|
1
|
+
import { ArrayType } from './ArrayType';
|
|
5
2
|
import { BigIntType } from './BigIntType';
|
|
6
3
|
import { BlobType } from './BlobType';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { BooleanType } from './BooleanType';
|
|
5
|
+
import { DateTimeType } from './DateTimeType';
|
|
6
|
+
import { DateType } from './DateType';
|
|
7
|
+
import { DecimalType } from './DecimalType';
|
|
8
|
+
import { DoubleType } from './DoubleType';
|
|
9
9
|
import { EnumArrayType } from './EnumArrayType';
|
|
10
10
|
import { EnumType } from './EnumType';
|
|
11
|
-
import {
|
|
11
|
+
import { CharacterType } from './CharacterType';
|
|
12
|
+
import { FloatType } from './FloatType';
|
|
12
13
|
import { IntegerType } from './IntegerType';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
14
|
+
import { IntervalType } from './IntervalType';
|
|
15
|
+
import { JsonType } from './JsonType';
|
|
15
16
|
import { MediumIntType } from './MediumIntType';
|
|
16
|
-
import {
|
|
17
|
-
import { DoubleType } from './DoubleType';
|
|
18
|
-
import { BooleanType } from './BooleanType';
|
|
19
|
-
import { DecimalType } from './DecimalType';
|
|
17
|
+
import { SmallIntType } from './SmallIntType';
|
|
20
18
|
import { StringType } from './StringType';
|
|
21
|
-
import { UuidType } from './UuidType';
|
|
22
19
|
import { TextType } from './TextType';
|
|
23
|
-
import {
|
|
20
|
+
import { TimeType } from './TimeType';
|
|
21
|
+
import { TinyIntType } from './TinyIntType';
|
|
22
|
+
import { IType, TransformContext, Type } from './Type';
|
|
23
|
+
import { Uint8ArrayType } from './Uint8ArrayType';
|
|
24
24
|
import { UnknownType } from './UnknownType';
|
|
25
|
-
|
|
25
|
+
import { UuidType } from './UuidType';
|
|
26
|
+
export { Type, DateType, TimeType, DateTimeType, BigIntType, BlobType, Uint8ArrayType, ArrayType, EnumArrayType, EnumType, JsonType, IntegerType, SmallIntType, TinyIntType, MediumIntType, FloatType, DoubleType, BooleanType, DecimalType, StringType, UuidType, TextType, UnknownType, TransformContext, IntervalType, IType, CharacterType, };
|
|
26
27
|
export declare const types: {
|
|
27
28
|
readonly date: typeof DateType;
|
|
28
29
|
readonly time: typeof TimeType;
|
|
@@ -42,6 +43,7 @@ export declare const types: {
|
|
|
42
43
|
readonly double: typeof DoubleType;
|
|
43
44
|
readonly boolean: typeof BooleanType;
|
|
44
45
|
readonly decimal: typeof DecimalType;
|
|
46
|
+
readonly character: typeof CharacterType;
|
|
45
47
|
readonly string: typeof StringType;
|
|
46
48
|
readonly uuid: typeof UuidType;
|
|
47
49
|
readonly text: typeof TextType;
|
|
@@ -67,6 +69,7 @@ export declare const t: {
|
|
|
67
69
|
readonly double: typeof DoubleType;
|
|
68
70
|
readonly boolean: typeof BooleanType;
|
|
69
71
|
readonly decimal: typeof DecimalType;
|
|
72
|
+
readonly character: typeof CharacterType;
|
|
70
73
|
readonly string: typeof StringType;
|
|
71
74
|
readonly uuid: typeof UuidType;
|
|
72
75
|
readonly text: typeof TextType;
|
package/types/index.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.t = exports.types = exports.IntervalType = exports.UnknownType = exports.TextType = exports.UuidType = exports.StringType = exports.DecimalType = exports.BooleanType = exports.DoubleType = exports.FloatType = exports.MediumIntType = exports.TinyIntType = exports.SmallIntType = exports.IntegerType = exports.JsonType = exports.EnumType = exports.EnumArrayType = exports.ArrayType = exports.Uint8ArrayType = exports.BlobType = exports.BigIntType = exports.DateTimeType = exports.TimeType = exports.DateType = exports.Type = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
const DateType_1 = require("./DateType");
|
|
7
|
-
Object.defineProperty(exports, "DateType", { enumerable: true, get: function () { return DateType_1.DateType; } });
|
|
8
|
-
const TimeType_1 = require("./TimeType");
|
|
9
|
-
Object.defineProperty(exports, "TimeType", { enumerable: true, get: function () { return TimeType_1.TimeType; } });
|
|
10
|
-
const DateTimeType_1 = require("./DateTimeType");
|
|
11
|
-
Object.defineProperty(exports, "DateTimeType", { enumerable: true, get: function () { return DateTimeType_1.DateTimeType; } });
|
|
3
|
+
exports.t = exports.types = exports.CharacterType = exports.IntervalType = exports.UnknownType = exports.TextType = exports.UuidType = exports.StringType = exports.DecimalType = exports.BooleanType = exports.DoubleType = exports.FloatType = exports.MediumIntType = exports.TinyIntType = exports.SmallIntType = exports.IntegerType = exports.JsonType = exports.EnumType = exports.EnumArrayType = exports.ArrayType = exports.Uint8ArrayType = exports.BlobType = exports.BigIntType = exports.DateTimeType = exports.TimeType = exports.DateType = exports.Type = void 0;
|
|
4
|
+
const ArrayType_1 = require("./ArrayType");
|
|
5
|
+
Object.defineProperty(exports, "ArrayType", { enumerable: true, get: function () { return ArrayType_1.ArrayType; } });
|
|
12
6
|
const BigIntType_1 = require("./BigIntType");
|
|
13
7
|
Object.defineProperty(exports, "BigIntType", { enumerable: true, get: function () { return BigIntType_1.BigIntType; } });
|
|
14
8
|
const BlobType_1 = require("./BlobType");
|
|
15
9
|
Object.defineProperty(exports, "BlobType", { enumerable: true, get: function () { return BlobType_1.BlobType; } });
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
const
|
|
19
|
-
Object.defineProperty(exports, "
|
|
10
|
+
const BooleanType_1 = require("./BooleanType");
|
|
11
|
+
Object.defineProperty(exports, "BooleanType", { enumerable: true, get: function () { return BooleanType_1.BooleanType; } });
|
|
12
|
+
const DateTimeType_1 = require("./DateTimeType");
|
|
13
|
+
Object.defineProperty(exports, "DateTimeType", { enumerable: true, get: function () { return DateTimeType_1.DateTimeType; } });
|
|
14
|
+
const DateType_1 = require("./DateType");
|
|
15
|
+
Object.defineProperty(exports, "DateType", { enumerable: true, get: function () { return DateType_1.DateType; } });
|
|
16
|
+
const DecimalType_1 = require("./DecimalType");
|
|
17
|
+
Object.defineProperty(exports, "DecimalType", { enumerable: true, get: function () { return DecimalType_1.DecimalType; } });
|
|
18
|
+
const DoubleType_1 = require("./DoubleType");
|
|
19
|
+
Object.defineProperty(exports, "DoubleType", { enumerable: true, get: function () { return DoubleType_1.DoubleType; } });
|
|
20
20
|
const EnumArrayType_1 = require("./EnumArrayType");
|
|
21
21
|
Object.defineProperty(exports, "EnumArrayType", { enumerable: true, get: function () { return EnumArrayType_1.EnumArrayType; } });
|
|
22
22
|
const EnumType_1 = require("./EnumType");
|
|
23
23
|
Object.defineProperty(exports, "EnumType", { enumerable: true, get: function () { return EnumType_1.EnumType; } });
|
|
24
|
-
const
|
|
25
|
-
Object.defineProperty(exports, "
|
|
24
|
+
const CharacterType_1 = require("./CharacterType");
|
|
25
|
+
Object.defineProperty(exports, "CharacterType", { enumerable: true, get: function () { return CharacterType_1.CharacterType; } });
|
|
26
|
+
const FloatType_1 = require("./FloatType");
|
|
27
|
+
Object.defineProperty(exports, "FloatType", { enumerable: true, get: function () { return FloatType_1.FloatType; } });
|
|
26
28
|
const IntegerType_1 = require("./IntegerType");
|
|
27
29
|
Object.defineProperty(exports, "IntegerType", { enumerable: true, get: function () { return IntegerType_1.IntegerType; } });
|
|
28
|
-
const
|
|
29
|
-
Object.defineProperty(exports, "
|
|
30
|
-
const
|
|
31
|
-
Object.defineProperty(exports, "
|
|
30
|
+
const IntervalType_1 = require("./IntervalType");
|
|
31
|
+
Object.defineProperty(exports, "IntervalType", { enumerable: true, get: function () { return IntervalType_1.IntervalType; } });
|
|
32
|
+
const JsonType_1 = require("./JsonType");
|
|
33
|
+
Object.defineProperty(exports, "JsonType", { enumerable: true, get: function () { return JsonType_1.JsonType; } });
|
|
32
34
|
const MediumIntType_1 = require("./MediumIntType");
|
|
33
35
|
Object.defineProperty(exports, "MediumIntType", { enumerable: true, get: function () { return MediumIntType_1.MediumIntType; } });
|
|
34
|
-
const
|
|
35
|
-
Object.defineProperty(exports, "
|
|
36
|
-
const DoubleType_1 = require("./DoubleType");
|
|
37
|
-
Object.defineProperty(exports, "DoubleType", { enumerable: true, get: function () { return DoubleType_1.DoubleType; } });
|
|
38
|
-
const BooleanType_1 = require("./BooleanType");
|
|
39
|
-
Object.defineProperty(exports, "BooleanType", { enumerable: true, get: function () { return BooleanType_1.BooleanType; } });
|
|
40
|
-
const DecimalType_1 = require("./DecimalType");
|
|
41
|
-
Object.defineProperty(exports, "DecimalType", { enumerable: true, get: function () { return DecimalType_1.DecimalType; } });
|
|
36
|
+
const SmallIntType_1 = require("./SmallIntType");
|
|
37
|
+
Object.defineProperty(exports, "SmallIntType", { enumerable: true, get: function () { return SmallIntType_1.SmallIntType; } });
|
|
42
38
|
const StringType_1 = require("./StringType");
|
|
43
39
|
Object.defineProperty(exports, "StringType", { enumerable: true, get: function () { return StringType_1.StringType; } });
|
|
44
|
-
const UuidType_1 = require("./UuidType");
|
|
45
|
-
Object.defineProperty(exports, "UuidType", { enumerable: true, get: function () { return UuidType_1.UuidType; } });
|
|
46
40
|
const TextType_1 = require("./TextType");
|
|
47
41
|
Object.defineProperty(exports, "TextType", { enumerable: true, get: function () { return TextType_1.TextType; } });
|
|
48
|
-
const
|
|
49
|
-
Object.defineProperty(exports, "
|
|
42
|
+
const TimeType_1 = require("./TimeType");
|
|
43
|
+
Object.defineProperty(exports, "TimeType", { enumerable: true, get: function () { return TimeType_1.TimeType; } });
|
|
44
|
+
const TinyIntType_1 = require("./TinyIntType");
|
|
45
|
+
Object.defineProperty(exports, "TinyIntType", { enumerable: true, get: function () { return TinyIntType_1.TinyIntType; } });
|
|
46
|
+
const Type_1 = require("./Type");
|
|
47
|
+
Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return Type_1.Type; } });
|
|
48
|
+
const Uint8ArrayType_1 = require("./Uint8ArrayType");
|
|
49
|
+
Object.defineProperty(exports, "Uint8ArrayType", { enumerable: true, get: function () { return Uint8ArrayType_1.Uint8ArrayType; } });
|
|
50
50
|
const UnknownType_1 = require("./UnknownType");
|
|
51
51
|
Object.defineProperty(exports, "UnknownType", { enumerable: true, get: function () { return UnknownType_1.UnknownType; } });
|
|
52
|
+
const UuidType_1 = require("./UuidType");
|
|
53
|
+
Object.defineProperty(exports, "UuidType", { enumerable: true, get: function () { return UuidType_1.UuidType; } });
|
|
52
54
|
exports.types = {
|
|
53
55
|
date: DateType_1.DateType,
|
|
54
56
|
time: TimeType_1.TimeType,
|
|
@@ -68,6 +70,7 @@ exports.types = {
|
|
|
68
70
|
double: DoubleType_1.DoubleType,
|
|
69
71
|
boolean: BooleanType_1.BooleanType,
|
|
70
72
|
decimal: DecimalType_1.DecimalType,
|
|
73
|
+
character: CharacterType_1.CharacterType,
|
|
71
74
|
string: StringType_1.StringType,
|
|
72
75
|
uuid: UuidType_1.UuidType,
|
|
73
76
|
text: TextType_1.TextType,
|