@mikro-orm/core 7.1.0-dev.21 → 7.1.0-dev.22

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.
@@ -117,7 +117,7 @@ export interface PropertyChain<Value, Options> {
117
117
  groups(...groups: string[]): PropertyChain<Value, Options>;
118
118
  customOrder(...customOrder: string[] | number[] | boolean[]): PropertyChain<Value, Options>;
119
119
  extra(extra: string): PropertyChain<Value, Options>;
120
- ignoreSchemaChanges(...ignoreSchemaChanges: ('type' | 'extra' | 'default')[]): PropertyChain<Value, Options>;
120
+ ignoreSchemaChanges(...ignoreSchemaChanges: ('type' | 'extra' | 'default' | 'collation')[]): PropertyChain<Value, Options>;
121
121
  /** Explicitly specify index on a property. When a string name is passed, it enables type-safe `using` in `FindOptions`. */
122
122
  index<N extends string>(name: N): PropertyChain<Value, Omit<Options, 'index'> & {
123
123
  index: N;
@@ -129,6 +129,7 @@ export interface PropertyChain<Value, Options> {
129
129
  }>;
130
130
  unique(unique?: boolean): PropertyChain<Value, Options>;
131
131
  comment(comment: string): PropertyChain<Value, Options>;
132
+ collation(collation: string): PropertyChain<Value, Options>;
132
133
  accessor(accessor?: string | boolean): PropertyChain<Value, Options>;
133
134
  eager(eager?: boolean): HasKind<Options, 'm:1' | '1:m' | '1:1' | 'm:n'> extends true ? PropertyChain<Value, Options> : never;
134
135
  cascade(...cascade: Cascade[]): HasKind<Options, 'm:1' | '1:m' | '1:1' | 'm:n'> extends true ? PropertyChain<Value, Options> : never;
@@ -478,6 +479,11 @@ export declare class UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys
478
479
  * Specify comment of column for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}. (SQL only)
479
480
  */
480
481
  comment(comment: string): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
482
+ /**
483
+ * Specify column-level collation for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}. (SQL only)
484
+ * Emits a `COLLATE` clause on the column definition; the accepted collation names are dialect-specific.
485
+ */
486
+ collation(collation: string): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
481
487
  /** mysql only */
482
488
  extra(extra: string): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
483
489
  /**
@@ -485,7 +491,7 @@ export declare class UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys
485
491
  *
486
492
  * @see https://mikro-orm.io/docs/defining-entities#sql-generated-columns
487
493
  */
488
- ignoreSchemaChanges(...ignoreSchemaChanges: ('type' | 'extra' | 'default')[]): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
494
+ ignoreSchemaChanges(...ignoreSchemaChanges: ('type' | 'extra' | 'default' | 'collation')[]): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
489
495
  array(): Pick<UniversalPropertyOptionsBuilder<Value, Omit<Options, 'array'> & {
490
496
  array: true;
491
497
  }, IncludeKeys>, IncludeKeys>;
@@ -316,6 +316,13 @@ export class UniversalPropertyOptionsBuilder {
316
316
  comment(comment) {
317
317
  return this.assignOptions({ comment });
318
318
  }
319
+ /**
320
+ * Specify column-level collation for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}. (SQL only)
321
+ * Emits a `COLLATE` clause on the column definition; the accepted collation names are dialect-specific.
322
+ */
323
+ collation(collation) {
324
+ return this.assignOptions({ collation });
325
+ }
319
326
  /** mysql only */
320
327
  extra(extra) {
321
328
  return this.assignOptions({ extra });
@@ -381,6 +381,11 @@ export interface PropertyOptions<Owner> {
381
381
  * Specify comment of column for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}. (SQL only)
382
382
  */
383
383
  comment?: string;
384
+ /**
385
+ * Specify column-level collation for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}. (SQL only)
386
+ * Emits a `COLLATE` clause on the column definition; the accepted collation names are dialect-specific.
387
+ */
388
+ collation?: string;
384
389
  /** mysql only */
385
390
  extra?: string;
386
391
  /**
@@ -388,7 +393,7 @@ export interface PropertyOptions<Owner> {
388
393
  *
389
394
  * @see https://mikro-orm.io/docs/defining-entities#sql-generated-columns
390
395
  */
391
- ignoreSchemaChanges?: ('type' | 'extra' | 'default')[];
396
+ ignoreSchemaChanges?: ('type' | 'extra' | 'default' | 'collation')[];
392
397
  }
393
398
  export interface ReferenceOptions<Owner, Target> extends PropertyOptions<Owner> {
394
399
  /** Set target entity type. For polymorphic relations, pass an array of entity types. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.1.0-dev.21",
3
+ "version": "7.1.0-dev.22",
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
  "keywords": [
6
6
  "data-mapper",
package/typings.d.ts CHANGED
@@ -809,11 +809,12 @@ export interface EntityProperty<Owner = any, Target = any> {
809
809
  serializer?: (value: any, options?: SerializeOptions<any>) => any;
810
810
  serializedName?: string;
811
811
  comment?: string;
812
+ collation?: string;
812
813
  /** mysql only */
813
814
  extra?: string;
814
815
  userDefined?: boolean;
815
816
  optional?: boolean;
816
- ignoreSchemaChanges?: ('type' | 'extra' | 'default')[];
817
+ ignoreSchemaChanges?: ('type' | 'extra' | 'default' | 'collation')[];
817
818
  deferMode?: DeferMode;
818
819
  createForeignKeyConstraint: boolean;
819
820
  foreignKeyName?: string;
package/utils/Utils.js CHANGED
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
141
141
  /** Collection of general-purpose utility methods used throughout the ORM. */
142
142
  export class Utils {
143
143
  static PK_SEPARATOR = '~~~';
144
- static #ORM_VERSION = '7.1.0-dev.21';
144
+ static #ORM_VERSION = '7.1.0-dev.22';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */