@mikro-orm/core 6.2.10-dev.8 → 6.2.10-dev.81

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.
Files changed (82) hide show
  1. package/EntityManager.d.ts +1 -2
  2. package/EntityManager.js +26 -24
  3. package/decorators/Check.js +1 -2
  4. package/decorators/CreateRequestContext.js +2 -3
  5. package/decorators/Embeddable.js +1 -2
  6. package/decorators/Embedded.js +1 -2
  7. package/decorators/Entity.js +1 -2
  8. package/decorators/Enum.js +1 -2
  9. package/decorators/Filter.js +1 -2
  10. package/decorators/Formula.js +1 -2
  11. package/decorators/Indexed.d.ts +3 -3
  12. package/decorators/Indexed.js +2 -3
  13. package/decorators/ManyToMany.js +1 -2
  14. package/decorators/ManyToOne.js +1 -2
  15. package/decorators/OneToMany.js +2 -3
  16. package/decorators/OneToOne.d.ts +1 -1
  17. package/decorators/OneToOne.js +1 -2
  18. package/decorators/PrimaryKey.d.ts +3 -2
  19. package/decorators/PrimaryKey.js +2 -3
  20. package/decorators/Property.d.ts +1 -1
  21. package/decorators/Property.js +1 -2
  22. package/decorators/hooks.js +10 -11
  23. package/drivers/DatabaseDriver.js +1 -1
  24. package/drivers/IDatabaseDriver.d.ts +2 -1
  25. package/entity/ArrayCollection.d.ts +0 -1
  26. package/entity/EntityIdentifier.d.ts +1 -1
  27. package/entity/EntityLoader.js +3 -0
  28. package/entity/Reference.d.ts +0 -1
  29. package/entity/Reference.js +10 -7
  30. package/entity/WrappedEntity.d.ts +0 -1
  31. package/entity/wrap.js +2 -3
  32. package/events/TransactionEventBroadcaster.d.ts +2 -2
  33. package/index.mjs +1 -0
  34. package/metadata/MetadataDiscovery.js +6 -4
  35. package/naming-strategy/AbstractNamingStrategy.d.ts +8 -0
  36. package/naming-strategy/AbstractNamingStrategy.js +12 -0
  37. package/naming-strategy/NamingStrategy.d.ts +21 -0
  38. package/package.json +2 -2
  39. package/platforms/Platform.d.ts +5 -1
  40. package/platforms/Platform.js +12 -4
  41. package/serialization/EntitySerializer.js +2 -2
  42. package/serialization/SerializationContext.d.ts +2 -2
  43. package/types/BigIntType.d.ts +2 -2
  44. package/types/BigIntType.js +1 -1
  45. package/types/BlobType.d.ts +0 -1
  46. package/types/CharacterType.d.ts +7 -0
  47. package/types/CharacterType.js +13 -0
  48. package/types/DateTimeType.d.ts +1 -0
  49. package/types/DateTimeType.js +3 -0
  50. package/types/DateType.d.ts +1 -0
  51. package/types/DateType.js +3 -0
  52. package/types/DecimalType.d.ts +2 -2
  53. package/types/IntervalType.d.ts +1 -0
  54. package/types/IntervalType.js +3 -0
  55. package/types/StringType.d.ts +1 -0
  56. package/types/StringType.js +3 -0
  57. package/types/TimeType.d.ts +1 -0
  58. package/types/TimeType.js +3 -0
  59. package/types/Type.d.ts +16 -2
  60. package/types/Uint8ArrayType.d.ts +0 -1
  61. package/types/index.d.ts +19 -16
  62. package/types/index.js +34 -31
  63. package/typings.d.ts +19 -19
  64. package/unit-of-work/ChangeSet.d.ts +0 -1
  65. package/unit-of-work/ChangeSetPersister.d.ts +1 -1
  66. package/unit-of-work/ChangeSetPersister.js +5 -3
  67. package/unit-of-work/UnitOfWork.d.ts +1 -1
  68. package/unit-of-work/UnitOfWork.js +32 -18
  69. package/utils/Configuration.js +2 -2
  70. package/utils/ConfigurationLoader.js +1 -0
  71. package/utils/Cursor.d.ts +0 -1
  72. package/utils/DataloaderUtils.d.ts +3 -3
  73. package/utils/DataloaderUtils.js +4 -4
  74. package/utils/EntityComparator.d.ts +13 -0
  75. package/utils/EntityComparator.js +62 -34
  76. package/utils/RawQueryFragment.d.ts +1 -2
  77. package/utils/RawQueryFragment.js +4 -4
  78. package/utils/Utils.d.ts +4 -6
  79. package/utils/Utils.js +13 -10
  80. package/utils/clone.js +1 -2
  81. package/utils/upsert-utils.d.ts +3 -2
  82. package/utils/upsert-utils.js +4 -5
@@ -109,7 +109,7 @@ class MetadataDiscovery {
109
109
  }
110
110
  }
111
111
  }
112
- filtered.forEach(meta => Object.values(meta.properties).forEach(prop => this.initIndexes(prop)));
112
+ filtered.forEach(meta => Object.values(meta.properties).forEach(prop => this.initIndexes(meta, prop)));
113
113
  filtered.forEach(meta => this.autoWireBidirectionalProperties(meta));
114
114
  filtered.forEach(meta => this.findReferencingProperties(meta, filtered));
115
115
  for (const meta of filtered) {
@@ -1147,7 +1147,8 @@ class MetadataDiscovery {
1147
1147
  && !SCALAR_TYPES.includes(prop.type)
1148
1148
  // or it might be inferred via ts-morph to some generic type alias
1149
1149
  && !prop.type.match(/[<>:"';{}]/)) {
1150
- prop.columnTypes = [prop.type];
1150
+ const type = prop.length != null && !prop.type.endsWith(`(${prop.length})`) ? `${prop.type}(${prop.length})` : prop.type;
1151
+ prop.columnTypes = [type];
1151
1152
  }
1152
1153
  else {
1153
1154
  prop.columnTypes = [mappedType.getColumnType(prop, this.platform)];
@@ -1204,8 +1205,9 @@ class MetadataDiscovery {
1204
1205
  }
1205
1206
  prop.unsigned ??= (prop.primary || prop.unsigned) && this.isNumericProperty(prop) && this.platform.supportsUnsigned();
1206
1207
  }
1207
- initIndexes(prop) {
1208
- if (prop.kind === enums_1.ReferenceKind.MANY_TO_ONE && this.platform.indexForeignKeys()) {
1208
+ initIndexes(meta, prop) {
1209
+ const hasIndex = meta.indexes.some(idx => idx.properties?.length === 1 && idx.properties[0] === prop.name);
1210
+ if (prop.kind === enums_1.ReferenceKind.MANY_TO_ONE && this.platform.indexForeignKeys() && !hasIndex) {
1209
1211
  prop.index ??= true;
1210
1212
  }
1211
1213
  }
@@ -8,6 +8,14 @@ export declare abstract class AbstractNamingStrategy implements NamingStrategy {
8
8
  */
9
9
  getEntityName(tableName: string, schemaName?: string): string;
10
10
  columnNameToProperty(columnName: string): string;
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ getEnumClassName(columnName: string, tableName: string, schemaName?: string): string;
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ enumValueToEnumProperty(enumValue: string, columnName: string, tableName: string, schemaName?: string): string;
11
19
  aliasName(entityName: string, index: number): string;
12
20
  abstract classToTableName(entityName: string): string;
13
21
  abstract joinColumnName(propertyName: string): string;
@@ -47,6 +47,18 @@ class AbstractNamingStrategy {
47
47
  }
48
48
  return propName;
49
49
  }
50
+ /**
51
+ * @inheritDoc
52
+ */
53
+ getEnumClassName(columnName, tableName, schemaName) {
54
+ return this.getEntityName(`${tableName}_${columnName}`, schemaName);
55
+ }
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ enumValueToEnumProperty(enumValue, columnName, tableName, schemaName) {
60
+ return enumValue.toUpperCase();
61
+ }
50
62
  aliasName(entityName, index) {
51
63
  // Take only the first letter of the prefix to keep character counts down since some engines have character limits
52
64
  return entityName.charAt(0).toLowerCase() + index;
@@ -15,6 +15,27 @@ export interface NamingStrategy {
15
15
  * Return a column name for a property
16
16
  */
17
17
  propertyToColumnName(propertyName: string, object?: boolean): string;
18
+ /**
19
+ * Get an enum class name.
20
+ *
21
+ * @param columnName The column name which has the enum.
22
+ * @param tableName The table name of the column.
23
+ * @param schemaName The schema name of the column.
24
+ *
25
+ * @return A new class name that will be used for the enum.
26
+ */
27
+ getEnumClassName(columnName: string, tableName: string, schemaName?: string): string;
28
+ /**
29
+ * Get an enum option name for a given enum value.
30
+ *
31
+ * @param enumValue The enum value to generate a name for.
32
+ * @param columnName The column name which has the enum.
33
+ * @param tableName The table name of the column.
34
+ * @param schemaName The schema name of the column.
35
+ *
36
+ * @return The name of the enum property that will hold the value.
37
+ */
38
+ enumValueToEnumProperty(enumValue: string, columnName: string, tableName: string, schemaName?: string): string;
18
39
  /**
19
40
  * Return a name of the entity class based on database table name (used in `EntityGenerator`).
20
41
  * Default implementation ignores the schema name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.2.10-dev.8",
3
+ "version": "6.2.10-dev.81",
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.8",
67
+ "mikro-orm": "6.2.10-dev.81",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -58,6 +58,8 @@ export declare abstract class Platform {
58
58
  length?: number;
59
59
  }): string;
60
60
  getDefaultDateTimeLength(): number;
61
+ getDefaultVarcharLength(): number;
62
+ getDefaultCharLength(): number;
61
63
  getDateTypeDeclarationSQL(length?: number): string;
62
64
  getTimeTypeDeclarationSQL(length?: number): string;
63
65
  getRegExpOperator(val?: unknown, flags?: string): string;
@@ -69,7 +71,6 @@ export declare abstract class Platform {
69
71
  quoteVersionValue(value: Date | number, prop: EntityProperty): Date | string | number;
70
72
  getDefaultVersionLength(): number;
71
73
  allowsComparingTuples(): boolean;
72
- allowsUniqueBatchUpdates(): boolean;
73
74
  isBigIntProperty(prop: EntityProperty): boolean;
74
75
  isRaw(value: any): boolean;
75
76
  getDefaultSchemaName(): string | undefined;
@@ -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;
@@ -96,6 +96,12 @@ class Platform {
96
96
  getDefaultDateTimeLength() {
97
97
  return 0;
98
98
  }
99
+ getDefaultVarcharLength() {
100
+ return 255;
101
+ }
102
+ getDefaultCharLength() {
103
+ return 1;
104
+ }
99
105
  getDateTypeDeclarationSQL(length) {
100
106
  return 'date' + (length ? `(${length})` : '');
101
107
  }
@@ -123,9 +129,6 @@ class Platform {
123
129
  allowsComparingTuples() {
124
130
  return true;
125
131
  }
126
- allowsUniqueBatchUpdates() {
127
- return true;
128
- }
129
132
  isBigIntProperty(prop) {
130
133
  return prop.columnTypes && prop.columnTypes[0] === 'bigint';
131
134
  }
@@ -153,8 +156,11 @@ 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
- return `varchar(${column.length ?? 255})`;
163
+ return `varchar(${column.length ?? this.getDefaultVarcharLength()})`;
158
164
  }
159
165
  getIntervalTypeDeclarationSQL(column) {
160
166
  return 'interval' + (column.length ? `(${column.length})` : '');
@@ -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);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serialize = exports.EntitySerializer = void 0;
3
+ exports.EntitySerializer = void 0;
4
+ exports.serialize = serialize;
4
5
  const wrap_1 = require("../entity/wrap");
5
6
  const Utils_1 = require("../utils/Utils");
6
7
  const enums_1 = require("../enums");
@@ -210,4 +211,3 @@ function serialize(entities, options) {
210
211
  }
211
212
  return EntitySerializer.serialize(entities, options);
212
213
  }
213
- exports.serialize = serialize;
@@ -5,7 +5,7 @@ import type { Configuration } from '../utils/Configuration';
5
5
  * Before we process a property, we call `visit` that checks if it is not a cycle path (but allows to pass cycles that
6
6
  * are defined in populate hint). If not, we proceed and call `leave` afterwards.
7
7
  */
8
- export declare class SerializationContext<T> {
8
+ export declare class SerializationContext<T extends object> {
9
9
  private readonly config;
10
10
  private readonly populate;
11
11
  private readonly fields?;
@@ -23,7 +23,7 @@ export declare class SerializationContext<T> {
23
23
  /**
24
24
  * When initializing new context, we need to propagate it to the whole entity graph recursively.
25
25
  */
26
- static propagate(root: SerializationContext<AnyEntity>, entity: AnyEntity, isVisible: (meta: EntityMetadata, prop: string) => boolean): void;
26
+ static propagate(root: SerializationContext<any>, entity: AnyEntity, isVisible: (meta: EntityMetadata, prop: string) => boolean): void;
27
27
  isMarkedAsPopulated(entityName: string, prop: string): boolean;
28
28
  isPartiallyLoaded(entityName: string, prop: string): boolean;
29
29
  private register;
@@ -6,8 +6,8 @@ import type { EntityProperty } from '../typings';
6
6
  * or numbers (safe only for values up to `Number.MAX_SAFE_INTEGER`), or strings, depending on the `mode`.
7
7
  */
8
8
  export declare class BigIntType extends Type<string | bigint | number | null | undefined, string | null | undefined> {
9
- mode?: "string" | "number" | "bigint" | undefined;
10
- constructor(mode?: "string" | "number" | "bigint" | undefined);
9
+ mode?: ("bigint" | "number" | "string") | undefined;
10
+ constructor(mode?: ("bigint" | "number" | "string") | undefined);
11
11
  convertToDatabaseValue(value: string | bigint | null | undefined): string | null | undefined;
12
12
  convertToJSValue(value: string | bigint | null | undefined): bigint | number | string | null | undefined;
13
13
  toJSON(value: string | bigint | null | undefined): string | bigint | null | undefined;
@@ -29,7 +29,7 @@ class BigIntType extends Type_1.Type {
29
29
  return String(value);
30
30
  case 'bigint':
31
31
  default:
32
- return BigInt(value);
32
+ return BigInt(String(value));
33
33
  }
34
34
  }
35
35
  toJSON(value) {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Uint8ArrayType } from './Uint8ArrayType';
3
2
  import type { Platform } from '../platforms';
4
3
  import type { EntityProperty } from '../typings';
@@ -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;
@@ -6,4 +6,5 @@ export declare class DateTimeType extends Type<Date, string> {
6
6
  compareAsType(): string;
7
7
  get runtimeType(): string;
8
8
  ensureComparable(): boolean;
9
+ getDefaultLength(platform: Platform): number;
9
10
  }
@@ -15,5 +15,8 @@ class DateTimeType extends Type_1.Type {
15
15
  ensureComparable() {
16
16
  return false;
17
17
  }
18
+ getDefaultLength(platform) {
19
+ return platform.getDefaultDateTimeLength();
20
+ }
18
21
  }
19
22
  exports.DateTimeType = DateTimeType;
@@ -6,4 +6,5 @@ export declare class DateType extends Type<string | null | undefined, string | n
6
6
  ensureComparable(): boolean;
7
7
  convertToJSValue(value: any, platform: Platform): string | null | undefined;
8
8
  getColumnType(prop: EntityProperty, platform: Platform): string;
9
+ getDefaultLength(platform: Platform): number;
9
10
  }
package/types/DateType.js CHANGED
@@ -15,5 +15,8 @@ class DateType extends Type_1.Type {
15
15
  getColumnType(prop, platform) {
16
16
  return platform.getDateTypeDeclarationSQL(prop.length);
17
17
  }
18
+ getDefaultLength(platform) {
19
+ return 0;
20
+ }
18
21
  }
19
22
  exports.DateType = DateType;
@@ -5,8 +5,8 @@ import type { EntityProperty } from '../typings';
5
5
  * Type that maps an SQL DECIMAL to a JS string or number.
6
6
  */
7
7
  export declare class DecimalType extends Type<string | number, string> {
8
- mode?: "string" | "number" | undefined;
9
- constructor(mode?: "string" | "number" | undefined);
8
+ mode?: ("number" | "string") | undefined;
9
+ constructor(mode?: ("number" | "string") | undefined);
10
10
  convertToJSValue(value: string): number | string;
11
11
  getColumnType(prop: EntityProperty, platform: Platform): string;
12
12
  compareAsType(): string;
@@ -5,4 +5,5 @@ export declare class IntervalType extends Type<string | null | undefined, string
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  convertToJSValue(value: string | null | undefined, platform: Platform): string | null | undefined;
7
7
  convertToDatabaseValue(value: string | null | undefined, platform: Platform): string | null | undefined;
8
+ getDefaultLength(platform: Platform): number;
8
9
  }
@@ -12,5 +12,8 @@ class IntervalType extends Type_1.Type {
12
12
  convertToDatabaseValue(value, platform) {
13
13
  return platform.convertIntervalToDatabaseValue(value);
14
14
  }
15
+ getDefaultLength(platform) {
16
+ return platform.getDefaultDateTimeLength();
17
+ }
15
18
  }
16
19
  exports.IntervalType = IntervalType;
@@ -5,4 +5,5 @@ export declare class StringType extends Type<string | null | undefined, string |
5
5
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
6
  compareAsType(): string;
7
7
  ensureComparable(): boolean;
8
+ getDefaultLength(platform: Platform): number;
8
9
  }
@@ -12,5 +12,8 @@ class StringType extends Type_1.Type {
12
12
  ensureComparable() {
13
13
  return false;
14
14
  }
15
+ getDefaultLength(platform) {
16
+ return platform.getDefaultVarcharLength();
17
+ }
15
18
  }
16
19
  exports.StringType = StringType;
@@ -6,4 +6,5 @@ export declare class TimeType extends Type {
6
6
  compareAsType(): string;
7
7
  ensureComparable(): boolean;
8
8
  getColumnType(prop: EntityProperty, platform: Platform): string;
9
+ getDefaultLength(platform: Platform): number;
9
10
  }
package/types/TimeType.js CHANGED
@@ -19,5 +19,8 @@ class TimeType extends Type_1.Type {
19
19
  getColumnType(prop, platform) {
20
20
  return platform.getTimeTypeDeclarationSQL(prop.length);
21
21
  }
22
+ getDefaultLength(platform) {
23
+ return platform.getDefaultDateTimeLength();
24
+ }
22
25
  }
23
26
  exports.TimeType = TimeType;
package/types/Type.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { inspect } from 'util';
3
2
  import type { Platform } from '../platforms';
4
3
  import type { Constructor, EntityMetadata, EntityProperty } from '../typings';
@@ -59,7 +58,22 @@ export declare abstract class Type<JSType = string, DBType = JSType> {
59
58
  * Gets the SQL declaration snippet for a field of this type.
60
59
  */
61
60
  getColumnType(prop: EntityProperty, platform: Platform): string;
62
- static getType<JSType, DBType = JSType>(cls: Constructor<Type<JSType, DBType>>): Type<JSType, DBType>;
61
+ /**
62
+ * Get the default length for values of this type
63
+ *
64
+ * When doing schema generation, if neither "length" nor "columnType" option is provided,
65
+ * the length will be defaulted to this value.
66
+ *
67
+ * When doing entity generation, if the type is recognized to this type, and the inferred length is this value,
68
+ * the length option will be omitted in the output. If this method is not defined, length is always outputted
69
+ * based on what is in the database metadata.
70
+ *
71
+ * @param platform The platform the default will be used for.
72
+ *
73
+ * @return The default value for the given platform.
74
+ */
75
+ getDefaultLength?(platform: Platform): number;
76
+ static getType<JSType, DBType = JSType, TypeClass extends Constructor<Type<JSType, DBType>> = Constructor<Type<JSType, DBType>>>(cls: TypeClass): InstanceType<TypeClass>;
63
77
  /**
64
78
  * Checks whether the argument is instance of `Type`.
65
79
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Type } from './Type';
3
2
  import type { Platform } from '../platforms';
4
3
  import type { EntityProperty } from '../typings';
package/types/index.d.ts CHANGED
@@ -1,28 +1,29 @@
1
- import { Type, TransformContext, IType } from './Type';
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 { Uint8ArrayType } from './Uint8ArrayType';
8
- import { ArrayType } from './ArrayType';
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 { JsonType } from './JsonType';
11
+ import { CharacterType } from './CharacterType';
12
+ import { FloatType } from './FloatType';
12
13
  import { IntegerType } from './IntegerType';
13
- import { SmallIntType } from './SmallIntType';
14
- import { TinyIntType } from './TinyIntType';
14
+ import { IntervalType } from './IntervalType';
15
+ import { JsonType } from './JsonType';
15
16
  import { MediumIntType } from './MediumIntType';
16
- import { FloatType } from './FloatType';
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 { IntervalType } from './IntervalType';
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
- 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, };
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 Type_1 = require("./Type");
5
- Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return Type_1.Type; } });
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 Uint8ArrayType_1 = require("./Uint8ArrayType");
17
- Object.defineProperty(exports, "Uint8ArrayType", { enumerable: true, get: function () { return Uint8ArrayType_1.Uint8ArrayType; } });
18
- const ArrayType_1 = require("./ArrayType");
19
- Object.defineProperty(exports, "ArrayType", { enumerable: true, get: function () { return ArrayType_1.ArrayType; } });
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 JsonType_1 = require("./JsonType");
25
- Object.defineProperty(exports, "JsonType", { enumerable: true, get: function () { return JsonType_1.JsonType; } });
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 SmallIntType_1 = require("./SmallIntType");
29
- Object.defineProperty(exports, "SmallIntType", { enumerable: true, get: function () { return SmallIntType_1.SmallIntType; } });
30
- const TinyIntType_1 = require("./TinyIntType");
31
- Object.defineProperty(exports, "TinyIntType", { enumerable: true, get: function () { return TinyIntType_1.TinyIntType; } });
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 FloatType_1 = require("./FloatType");
35
- Object.defineProperty(exports, "FloatType", { enumerable: true, get: function () { return FloatType_1.FloatType; } });
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 IntervalType_1 = require("./IntervalType");
49
- Object.defineProperty(exports, "IntervalType", { enumerable: true, get: function () { return IntervalType_1.IntervalType; } });
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,