@mikro-orm/core 7.0.2-dev.12 → 7.0.2-dev.14

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 (147) hide show
  1. package/EntityManager.d.ts +4 -0
  2. package/EntityManager.js +4 -0
  3. package/MikroORM.d.ts +2 -0
  4. package/MikroORM.js +2 -0
  5. package/cache/CacheAdapter.d.ts +2 -0
  6. package/cache/GeneratedCacheAdapter.d.ts +1 -0
  7. package/cache/GeneratedCacheAdapter.js +1 -0
  8. package/cache/MemoryCacheAdapter.d.ts +1 -0
  9. package/cache/MemoryCacheAdapter.js +1 -0
  10. package/cache/NullCacheAdapter.d.ts +1 -0
  11. package/cache/NullCacheAdapter.js +1 -0
  12. package/connections/Connection.d.ts +13 -0
  13. package/connections/Connection.js +9 -0
  14. package/drivers/DatabaseDriver.d.ts +12 -0
  15. package/drivers/DatabaseDriver.js +12 -0
  16. package/drivers/IDatabaseDriver.d.ts +44 -0
  17. package/drivers/IDatabaseDriver.js +1 -0
  18. package/entity/BaseEntity.d.ts +11 -0
  19. package/entity/BaseEntity.js +11 -0
  20. package/entity/Collection.d.ts +26 -0
  21. package/entity/Collection.js +15 -0
  22. package/entity/EntityAssigner.d.ts +3 -0
  23. package/entity/EntityAssigner.js +2 -0
  24. package/entity/EntityFactory.d.ts +16 -0
  25. package/entity/EntityFactory.js +6 -0
  26. package/entity/EntityLoader.d.ts +19 -0
  27. package/entity/EntityLoader.js +2 -0
  28. package/entity/EntityRepository.d.ts +2 -0
  29. package/entity/EntityRepository.js +2 -0
  30. package/entity/Reference.d.ts +20 -0
  31. package/entity/Reference.js +16 -0
  32. package/entity/WrappedEntity.d.ts +20 -0
  33. package/entity/WrappedEntity.js +21 -1
  34. package/entity/defineEntity.d.ts +10 -0
  35. package/entity/defineEntity.js +1 -0
  36. package/enums.d.ts +132 -0
  37. package/enums.js +132 -0
  38. package/errors.d.ts +6 -0
  39. package/errors.js +6 -0
  40. package/events/EventManager.d.ts +5 -0
  41. package/events/EventManager.js +5 -0
  42. package/events/EventSubscriber.d.ts +4 -0
  43. package/events/TransactionEventBroadcaster.d.ts +2 -0
  44. package/events/TransactionEventBroadcaster.js +2 -0
  45. package/hydration/Hydrator.d.ts +2 -0
  46. package/hydration/Hydrator.js +2 -0
  47. package/hydration/ObjectHydrator.d.ts +1 -0
  48. package/hydration/ObjectHydrator.js +1 -0
  49. package/logging/DefaultLogger.d.ts +3 -0
  50. package/logging/DefaultLogger.js +3 -0
  51. package/logging/Logger.d.ts +5 -0
  52. package/metadata/EntitySchema.d.ts +22 -0
  53. package/metadata/EntitySchema.js +20 -0
  54. package/metadata/MetadataDiscovery.d.ts +4 -0
  55. package/metadata/MetadataDiscovery.js +4 -0
  56. package/metadata/MetadataProvider.d.ts +8 -0
  57. package/metadata/MetadataProvider.js +8 -0
  58. package/metadata/MetadataStorage.d.ts +14 -0
  59. package/metadata/MetadataStorage.js +13 -0
  60. package/naming-strategy/AbstractNamingStrategy.d.ts +1 -0
  61. package/naming-strategy/AbstractNamingStrategy.js +1 -0
  62. package/naming-strategy/MongoNamingStrategy.d.ts +1 -0
  63. package/naming-strategy/MongoNamingStrategy.js +1 -0
  64. package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -0
  65. package/naming-strategy/UnderscoreNamingStrategy.js +1 -0
  66. package/package.json +1 -1
  67. package/platforms/ExceptionConverter.d.ts +1 -0
  68. package/platforms/ExceptionConverter.js +1 -0
  69. package/platforms/Platform.d.ts +65 -0
  70. package/platforms/Platform.js +65 -0
  71. package/serialization/EntitySerializer.d.ts +2 -0
  72. package/serialization/EntitySerializer.js +2 -0
  73. package/serialization/EntityTransformer.d.ts +2 -0
  74. package/serialization/EntityTransformer.js +2 -0
  75. package/serialization/SerializationContext.d.ts +5 -0
  76. package/serialization/SerializationContext.js +5 -0
  77. package/types/ArrayType.d.ts +1 -0
  78. package/types/ArrayType.js +1 -0
  79. package/types/BlobType.d.ts +1 -0
  80. package/types/BlobType.js +1 -0
  81. package/types/BooleanType.d.ts +1 -0
  82. package/types/BooleanType.js +1 -0
  83. package/types/CharacterType.d.ts +1 -0
  84. package/types/CharacterType.js +1 -0
  85. package/types/DateTimeType.d.ts +1 -0
  86. package/types/DateTimeType.js +1 -0
  87. package/types/DateType.d.ts +1 -0
  88. package/types/DateType.js +1 -0
  89. package/types/EnumArrayType.d.ts +1 -0
  90. package/types/EnumArrayType.js +1 -0
  91. package/types/EnumType.d.ts +1 -0
  92. package/types/EnumType.js +1 -0
  93. package/types/FloatType.d.ts +1 -0
  94. package/types/FloatType.js +1 -0
  95. package/types/IntegerType.d.ts +1 -0
  96. package/types/IntegerType.js +1 -0
  97. package/types/IntervalType.d.ts +1 -0
  98. package/types/IntervalType.js +1 -0
  99. package/types/JsonType.d.ts +1 -0
  100. package/types/JsonType.js +1 -0
  101. package/types/MediumIntType.d.ts +1 -0
  102. package/types/MediumIntType.js +1 -0
  103. package/types/SmallIntType.d.ts +1 -0
  104. package/types/SmallIntType.js +1 -0
  105. package/types/StringType.d.ts +1 -0
  106. package/types/StringType.js +1 -0
  107. package/types/TextType.d.ts +1 -0
  108. package/types/TextType.js +1 -0
  109. package/types/TimeType.d.ts +1 -0
  110. package/types/TimeType.js +1 -0
  111. package/types/TinyIntType.d.ts +1 -0
  112. package/types/TinyIntType.js +1 -0
  113. package/types/Type.d.ts +3 -0
  114. package/types/Type.js +1 -0
  115. package/types/Uint8ArrayType.d.ts +1 -0
  116. package/types/Uint8ArrayType.js +1 -0
  117. package/types/UnknownType.d.ts +1 -0
  118. package/types/UnknownType.js +1 -0
  119. package/types/UuidType.d.ts +1 -0
  120. package/types/UuidType.js +1 -0
  121. package/types/index.d.ts +2 -0
  122. package/types/index.js +2 -0
  123. package/typings.d.ts +177 -0
  124. package/typings.js +11 -0
  125. package/unit-of-work/ChangeSet.d.ts +4 -0
  126. package/unit-of-work/ChangeSet.js +4 -0
  127. package/unit-of-work/ChangeSetComputer.d.ts +2 -0
  128. package/unit-of-work/ChangeSetComputer.js +2 -0
  129. package/unit-of-work/ChangeSetPersister.d.ts +4 -0
  130. package/unit-of-work/ChangeSetPersister.js +4 -0
  131. package/unit-of-work/IdentityMap.d.ts +7 -0
  132. package/unit-of-work/IdentityMap.js +7 -0
  133. package/unit-of-work/UnitOfWork.d.ts +15 -0
  134. package/unit-of-work/UnitOfWork.js +15 -0
  135. package/utils/Configuration.d.ts +8 -0
  136. package/utils/Configuration.js +8 -0
  137. package/utils/EntityComparator.d.ts +2 -0
  138. package/utils/EntityComparator.js +2 -0
  139. package/utils/NullHighlighter.d.ts +1 -0
  140. package/utils/NullHighlighter.js +1 -0
  141. package/utils/RawQueryFragment.d.ts +10 -0
  142. package/utils/RawQueryFragment.js +9 -0
  143. package/utils/RequestContext.d.ts +1 -0
  144. package/utils/TransactionContext.d.ts +1 -0
  145. package/utils/TransactionContext.js +1 -0
  146. package/utils/Utils.d.ts +6 -0
  147. package/utils/Utils.js +7 -1
@@ -1,6 +1,7 @@
1
1
  import { Uint8ArrayType } from './Uint8ArrayType.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database BLOB/BYTEA column to a Node.js `Buffer`. */
4
5
  export declare class BlobType extends Uint8ArrayType {
5
6
  convertToJSValue(value: Buffer): Buffer | null;
6
7
  compareAsType(): string;
package/types/BlobType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Uint8ArrayType } from './Uint8ArrayType.js';
2
+ /** Maps a database BLOB/BYTEA column to a Node.js `Buffer`. */
2
3
  export class BlobType extends Uint8ArrayType {
3
4
  convertToJSValue(value) {
4
5
  if (value instanceof Buffer || !value) {
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database BOOLEAN/TINYINT(1) column to a JS `boolean`. */
4
5
  export declare class BooleanType extends Type<boolean | null | undefined, boolean | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database BOOLEAN/TINYINT(1) column to a JS `boolean`. */
2
3
  export class BooleanType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getBooleanTypeDeclarationSQL();
@@ -1,6 +1,7 @@
1
1
  import { StringType } from './StringType.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database CHAR (fixed-length) column to a JS `string`. */
4
5
  export declare class CharacterType extends StringType {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  getDefaultLength(platform: Platform): number;
@@ -1,4 +1,5 @@
1
1
  import { StringType } from './StringType.js';
2
+ /** Maps a database CHAR (fixed-length) column to a JS `string`. */
2
3
  export class CharacterType extends StringType {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getCharTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database DATETIME/TIMESTAMP column to a JS `Date` object. */
4
5
  export declare class DateTimeType extends Type<Date, string> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database DATETIME/TIMESTAMP column to a JS `Date` object. */
2
3
  export class DateTimeType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getDateTimeTypeDeclarationSQL({ length: prop.length });
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database DATE column (date without time) to a JS `string` in YYYY-MM-DD format. */
4
5
  export declare class DateType extends Type<string | null | undefined, string | null | undefined> {
5
6
  compareAsType(): string;
6
7
  ensureComparable(): boolean;
package/types/DateType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database DATE column (date without time) to a JS `string` in YYYY-MM-DD format. */
2
3
  export class DateType extends Type {
3
4
  compareAsType() {
4
5
  return 'string';
@@ -2,6 +2,7 @@ import { ArrayType } from './ArrayType.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { TransformContext } from './Type.js';
4
4
  import type { EntityProperty } from '../typings.js';
5
+ /** Maps a database array column to a JS array of enum values, with validation against allowed enum items. */
5
6
  export declare class EnumArrayType<T extends string | number = string> extends ArrayType<T> {
6
7
  private readonly owner;
7
8
  private readonly items?;
@@ -6,6 +6,7 @@ function mapHydrator(items, hydrate) {
6
6
  }
7
7
  return hydrate;
8
8
  }
9
+ /** Maps a database array column to a JS array of enum values, with validation against allowed enum items. */
9
10
  export class EnumArrayType extends ArrayType {
10
11
  owner;
11
12
  items;
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database ENUM or equivalent column to a JS string. Supports native database enums when available. */
4
5
  export declare class EnumType extends Type<string | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
package/types/EnumType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database ENUM or equivalent column to a JS string. Supports native database enums when available. */
2
3
  export class EnumType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  if (prop.nativeEnumName) {
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database FLOAT column to a JS `number`. */
4
5
  export declare class FloatType extends Type<number | null | undefined, number | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database FLOAT column to a JS `number`. */
2
3
  export class FloatType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getFloatDeclarationSQL();
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database INTEGER/INT column to a JS `number`. */
4
5
  export declare class IntegerType extends Type<number | null | undefined, number | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database INTEGER/INT column to a JS `number`. */
2
3
  export class IntegerType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getIntegerTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database INTERVAL column (PostgreSQL) to a JS `string`. */
4
5
  export declare class IntervalType extends Type<string | null | undefined, string | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  convertToJSValue(value: string | null | undefined, platform: Platform): string | null | undefined;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database INTERVAL column (PostgreSQL) to a JS `string`. */
2
3
  export class IntervalType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getIntervalTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type, type TransformContext } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityMetadata, EntityProperty } from '../typings.js';
4
+ /** Maps a database JSON/JSONB column to a JS object, handling serialization and deserialization. */
4
5
  export declare class JsonType extends Type<unknown, string | null> {
5
6
  convertToDatabaseValue(value: unknown, platform: Platform, context?: TransformContext): string | null;
6
7
  convertToJSValueSQL(key: string, platform: Platform): string;
package/types/JsonType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database JSON/JSONB column to a JS object, handling serialization and deserialization. */
2
3
  export class JsonType extends Type {
3
4
  convertToDatabaseValue(value, platform, context) {
4
5
  if (value == null) {
@@ -1,6 +1,7 @@
1
1
  import type { Platform } from '../platforms/Platform.js';
2
2
  import type { EntityProperty } from '../typings.js';
3
3
  import { IntegerType } from './IntegerType.js';
4
+ /** Maps a database MEDIUMINT column to a JS `number`. */
4
5
  export declare class MediumIntType extends IntegerType {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import { IntegerType } from './IntegerType.js';
2
+ /** Maps a database MEDIUMINT column to a JS `number`. */
2
3
  export class MediumIntType extends IntegerType {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getMediumIntTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database SMALLINT column to a JS `number`. */
4
5
  export declare class SmallIntType extends Type<number | null | undefined, number | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database SMALLINT column to a JS `number`. */
2
3
  export class SmallIntType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getSmallIntTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database VARCHAR column to a JS `string`. */
4
5
  export declare class StringType extends Type<string | null | undefined, string | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database VARCHAR column to a JS `string`. */
2
3
  export class StringType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getVarcharTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database TEXT column (unbounded length) to a JS `string`. */
4
5
  export declare class TextType extends Type<string | null | undefined, string | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
package/types/TextType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database TEXT column (unbounded length) to a JS `string`. */
2
3
  export class TextType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getTextTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database TIME column to a JS `string` in HH:MM:SS format. */
4
5
  export declare class TimeType extends Type {
5
6
  convertToDatabaseValue(value: any, platform: Platform): string;
6
7
  compareAsType(): string;
package/types/TimeType.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Type } from './Type.js';
2
2
  import { ValidationError } from '../errors.js';
3
+ /** Maps a database TIME column to a JS `string` in HH:MM:SS format. */
3
4
  export class TimeType extends Type {
4
5
  convertToDatabaseValue(value, platform) {
5
6
  if (value && !value.toString().match(/^\d{2,}:(?:[0-5]\d):(?:[0-5]\d)$/)) {
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database TINYINT column to a JS `number`. */
4
5
  export declare class TinyIntType extends Type<number | null | undefined, number | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database TINYINT column to a JS `number`. */
2
3
  export class TinyIntType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getTinyIntTypeDeclarationSQL(prop);
package/types/Type.d.ts CHANGED
@@ -2,17 +2,20 @@ import type { Platform } from '../platforms/Platform.js';
2
2
  import type { Constructor, EntityMetadata, EntityProperty } from '../typings.js';
3
3
  /** @internal */
4
4
  export declare const ORM_TYPE: unique symbol;
5
+ /** Context passed to type conversion methods, indicating the conversion mode and source. */
5
6
  export interface TransformContext {
6
7
  fromQuery?: boolean;
7
8
  force?: boolean;
8
9
  key?: string;
9
10
  mode?: 'hydration' | 'query' | 'query-data' | 'discovery' | 'serialization';
10
11
  }
12
+ /** Branded type helper for mapping between JS runtime, database raw, and JSON serialized representations. */
11
13
  export type IType<Runtime, Raw, Serialized = Raw> = Runtime & {
12
14
  __raw?: Raw;
13
15
  __runtime?: Runtime;
14
16
  __serialized?: Serialized;
15
17
  };
18
+ /** Abstract base class for custom property types that handle conversion between JS and database representations. */
16
19
  export declare abstract class Type<JSType = string, DBType = JSType> {
17
20
  private static readonly types;
18
21
  platform?: Platform;
package/types/Type.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { inspect } from '../logging/inspect.js';
2
2
  /** @internal */
3
3
  export const ORM_TYPE = Symbol.for('@mikro-orm/type');
4
+ /** Abstract base class for custom property types that handle conversion between JS and database representations. */
4
5
  export class Type {
5
6
  static types = new Map();
6
7
  platform;
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database BLOB/BYTEA column to a JS `Uint8Array`. */
4
5
  export declare class Uint8ArrayType extends Type<Uint8Array | null> {
5
6
  convertToDatabaseValue(value: Uint8Array): Buffer;
6
7
  convertToJSValue(value: Buffer): Uint8Array | null;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database BLOB/BYTEA column to a JS `Uint8Array`. */
2
3
  export class Uint8ArrayType extends Type {
3
4
  convertToDatabaseValue(value) {
4
5
  if (!value) {
@@ -1,6 +1,7 @@
1
1
  import type { EntityProperty } from '../typings.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import { Type } from './Type.js';
4
+ /** Passthrough type that performs no conversion, used when the column type is unknown or unrecognized. */
4
5
  export declare class UnknownType extends Type<unknown | null | undefined, unknown | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  get runtimeType(): string;
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Passthrough type that performs no conversion, used when the column type is unknown or unrecognized. */
2
3
  export class UnknownType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return prop.columnTypes?.[0] ?? platform.getVarcharTypeDeclarationSQL(prop);
@@ -1,6 +1,7 @@
1
1
  import { Type } from './Type.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
3
  import type { EntityProperty } from '../typings.js';
4
+ /** Maps a database UUID column to a JS `string`, with platform-specific normalization. */
4
5
  export declare class UuidType extends Type<string | null | undefined> {
5
6
  getColumnType(prop: EntityProperty, platform: Platform): string;
6
7
  compareAsType(): string;
package/types/UuidType.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from './Type.js';
2
+ /** Maps a database UUID column to a JS `string`, with platform-specific normalization. */
2
3
  export class UuidType extends Type {
3
4
  getColumnType(prop, platform) {
4
5
  return platform.getUuidTypeDeclarationSQL(prop);
package/types/index.d.ts CHANGED
@@ -25,6 +25,7 @@ import { UnknownType } from './UnknownType.js';
25
25
  import { UuidType } from './UuidType.js';
26
26
  export type { TransformContext, IType };
27
27
  export { Type, DateType, TimeType, DateTimeType, BigIntType, BlobType, Uint8ArrayType, ArrayType, EnumArrayType, EnumType, JsonType, IntegerType, SmallIntType, TinyIntType, MediumIntType, FloatType, DoubleType, BooleanType, DecimalType, StringType, UuidType, TextType, UnknownType, IntervalType, CharacterType, };
28
+ /** Registry of all built-in type constructors, keyed by their short name (e.g., `types.integer`, `types.uuid`). */
28
29
  export declare const types: {
29
30
  readonly date: typeof DateType;
30
31
  readonly time: typeof TimeType;
@@ -51,6 +52,7 @@ export declare const types: {
51
52
  readonly interval: typeof IntervalType;
52
53
  readonly unknown: typeof UnknownType;
53
54
  };
55
+ /** Shorthand alias for the `types` registry. */
54
56
  export declare const t: {
55
57
  readonly date: typeof DateType;
56
58
  readonly time: typeof TimeType;
package/types/index.js CHANGED
@@ -24,6 +24,7 @@ import { Uint8ArrayType } from './Uint8ArrayType.js';
24
24
  import { UnknownType } from './UnknownType.js';
25
25
  import { UuidType } from './UuidType.js';
26
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, IntervalType, CharacterType, };
27
+ /** Registry of all built-in type constructors, keyed by their short name (e.g., `types.integer`, `types.uuid`). */
27
28
  export const types = {
28
29
  date: DateType,
29
30
  time: TimeType,
@@ -50,6 +51,7 @@ export const types = {
50
51
  interval: IntervalType,
51
52
  unknown: UnknownType,
52
53
  };
54
+ /** Shorthand alias for the `types` registry. */
53
55
  export const t = types;
54
56
  /**
55
57
  * Brand each built-in type constructor with its registry key via a cross-module symbol.