@mikro-orm/knex 6.0.0-dev.6 → 6.0.0-dev.8

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.
@@ -1,7 +1,7 @@
1
1
  import type { Constructor, EntityManager, EntityRepository, IDatabaseDriver, MikroORM } from '@mikro-orm/core';
2
2
  import { Platform } from '@mikro-orm/core';
3
3
  import type { SchemaHelper } from './schema';
4
- import { SchemaGenerator } from './schema';
4
+ import { SqlSchemaGenerator } from './schema';
5
5
  export declare abstract class AbstractSqlPlatform extends Platform {
6
6
  protected readonly schemaHelper?: SchemaHelper;
7
7
  usesPivotTable(): boolean;
@@ -10,7 +10,7 @@ export declare abstract class AbstractSqlPlatform extends Platform {
10
10
  getSchemaHelper(): SchemaHelper | undefined;
11
11
  /** @inheritDoc */
12
12
  lookupExtensions(orm: MikroORM): void;
13
- getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): SchemaGenerator;
13
+ getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): SqlSchemaGenerator;
14
14
  quoteValue(value: any): string;
15
15
  formatQuery(sql: string, params: readonly any[]): string;
16
16
  getSearchJsonPropertySQL(path: string, type: string, aliased: boolean): string;
@@ -20,11 +20,11 @@ class AbstractSqlPlatform extends core_1.Platform {
20
20
  }
21
21
  /** @inheritDoc */
22
22
  lookupExtensions(orm) {
23
- schema_1.SchemaGenerator.register(orm);
23
+ schema_1.SqlSchemaGenerator.register(orm);
24
24
  }
25
25
  /* istanbul ignore next: kept for type inference only */
26
26
  getSchemaGenerator(driver, em) {
27
- return new schema_1.SchemaGenerator(em ?? driver);
27
+ return new schema_1.SqlSchemaGenerator(em ?? driver);
28
28
  }
29
29
  quoteValue(value) {
30
30
  if (this.isRaw(value)) {
package/index.d.ts CHANGED
@@ -15,3 +15,4 @@ export { SqlEntityManager as EntityManager } from './SqlEntityManager';
15
15
  export { SqlEntityRepository as EntityRepository } from './SqlEntityRepository';
16
16
  /** @ignore */
17
17
  export { Knex, knex } from 'knex';
18
+ export * from '@mikro-orm/core';
package/index.js CHANGED
@@ -37,3 +37,4 @@ Object.defineProperty(exports, "EntityRepository", { enumerable: true, get: func
37
37
  var knex_1 = require("knex");
38
38
  Object.defineProperty(exports, "Knex", { enumerable: true, get: function () { return knex_1.Knex; } });
39
39
  Object.defineProperty(exports, "knex", { enumerable: true, get: function () { return knex_1.knex; } });
40
+ __exportStar(require("@mikro-orm/core"), exports);
package/index.mjs CHANGED
@@ -1,26 +1,192 @@
1
1
  import mod from "./index.js";
2
2
 
3
3
  export default mod;
4
+ export const ARRAY_OPERATORS = mod.ARRAY_OPERATORS;
5
+ export const AbstractNamingStrategy = mod.AbstractNamingStrategy;
6
+ export const AbstractSchemaGenerator = mod.AbstractSchemaGenerator;
4
7
  export const AbstractSqlConnection = mod.AbstractSqlConnection;
5
8
  export const AbstractSqlDriver = mod.AbstractSqlDriver;
6
9
  export const AbstractSqlPlatform = mod.AbstractSqlPlatform;
10
+ export const AfterCreate = mod.AfterCreate;
11
+ export const AfterDelete = mod.AfterDelete;
12
+ export const AfterUpdate = mod.AfterUpdate;
13
+ export const ArrayCollection = mod.ArrayCollection;
7
14
  export const ArrayCriteriaNode = mod.ArrayCriteriaNode;
15
+ export const ArrayType = mod.ArrayType;
16
+ export const BaseEntity = mod.BaseEntity;
17
+ export const BeforeCreate = mod.BeforeCreate;
18
+ export const BeforeDelete = mod.BeforeDelete;
19
+ export const BeforeUpdate = mod.BeforeUpdate;
20
+ export const BigIntType = mod.BigIntType;
21
+ export const BlobType = mod.BlobType;
22
+ export const BooleanType = mod.BooleanType;
23
+ export const Cascade = mod.Cascade;
24
+ export const ChangeSet = mod.ChangeSet;
25
+ export const ChangeSetComputer = mod.ChangeSetComputer;
26
+ export const ChangeSetPersister = mod.ChangeSetPersister;
27
+ export const ChangeSetType = mod.ChangeSetType;
28
+ export const Check = mod.Check;
29
+ export const CheckConstraintViolationException = mod.CheckConstraintViolationException;
30
+ export const Collection = mod.Collection;
31
+ export const CommitOrderCalculator = mod.CommitOrderCalculator;
32
+ export const Configuration = mod.Configuration;
33
+ export const ConfigurationLoader = mod.ConfigurationLoader;
34
+ export const Connection = mod.Connection;
35
+ export const ConnectionException = mod.ConnectionException;
36
+ export const ConstraintViolationException = mod.ConstraintViolationException;
8
37
  export const CriteriaNode = mod.CriteriaNode;
9
38
  export const CriteriaNodeFactory = mod.CriteriaNodeFactory;
39
+ export const DatabaseDriver = mod.DatabaseDriver;
40
+ export const DatabaseObjectExistsException = mod.DatabaseObjectExistsException;
41
+ export const DatabaseObjectNotFoundException = mod.DatabaseObjectNotFoundException;
10
42
  export const DatabaseSchema = mod.DatabaseSchema;
11
43
  export const DatabaseTable = mod.DatabaseTable;
44
+ export const DateTimeType = mod.DateTimeType;
45
+ export const DateType = mod.DateType;
46
+ export const DeadlockException = mod.DeadlockException;
47
+ export const DecimalType = mod.DecimalType;
48
+ export const DefaultLogger = mod.DefaultLogger;
49
+ export const DoubleType = mod.DoubleType;
50
+ export const DriverException = mod.DriverException;
51
+ export const Embeddable = mod.Embeddable;
52
+ export const Embedded = mod.Embedded;
53
+ export const Entity = mod.Entity;
54
+ export const EntityAssigner = mod.EntityAssigner;
55
+ export const EntityCaseNamingStrategy = mod.EntityCaseNamingStrategy;
56
+ export const EntityComparator = mod.EntityComparator;
57
+ export const EntityFactory = mod.EntityFactory;
58
+ export const EntityHelper = mod.EntityHelper;
59
+ export const EntityIdentifier = mod.EntityIdentifier;
60
+ export const EntityLoader = mod.EntityLoader;
12
61
  export const EntityManager = mod.EntityManager;
62
+ export const EntityManagerType = mod.EntityManagerType;
63
+ export const EntityMetadata = mod.EntityMetadata;
13
64
  export const EntityRepository = mod.EntityRepository;
65
+ export const EntityRepositoryType = mod.EntityRepositoryType;
66
+ export const EntitySchema = mod.EntitySchema;
67
+ export const EntitySerializer = mod.EntitySerializer;
68
+ export const EntityTransformer = mod.EntityTransformer;
69
+ export const EntityValidator = mod.EntityValidator;
70
+ export const Enum = mod.Enum;
71
+ export const EnumArrayType = mod.EnumArrayType;
72
+ export const EnumType = mod.EnumType;
73
+ export const EventManager = mod.EventManager;
74
+ export const EventType = mod.EventType;
75
+ export const ExceptionConverter = mod.ExceptionConverter;
76
+ export const FileCacheAdapter = mod.FileCacheAdapter;
77
+ export const Filter = mod.Filter;
78
+ export const FloatType = mod.FloatType;
79
+ export const FlushMode = mod.FlushMode;
80
+ export const ForeignKeyConstraintViolationException = mod.ForeignKeyConstraintViolationException;
81
+ export const Formula = mod.Formula;
82
+ export const GroupOperator = mod.GroupOperator;
83
+ export const Hydrator = mod.Hydrator;
84
+ export const IdentityMap = mod.IdentityMap;
85
+ export const Index = mod.Index;
86
+ export const IntegerType = mod.IntegerType;
87
+ export const InvalidFieldNameException = mod.InvalidFieldNameException;
88
+ export const IsolationLevel = mod.IsolationLevel;
89
+ export const JavaScriptMetadataProvider = mod.JavaScriptMetadataProvider;
90
+ export const JsonProperty = mod.JsonProperty;
91
+ export const JsonType = mod.JsonType;
14
92
  export const Knex = mod.Knex;
93
+ export const LoadStrategy = mod.LoadStrategy;
94
+ export const LockMode = mod.LockMode;
95
+ export const LockWaitTimeoutException = mod.LockWaitTimeoutException;
96
+ export const ManyToMany = mod.ManyToMany;
97
+ export const ManyToOne = mod.ManyToOne;
98
+ export const MediumIntType = mod.MediumIntType;
99
+ export const MemoryCacheAdapter = mod.MemoryCacheAdapter;
100
+ export const MetadataDiscovery = mod.MetadataDiscovery;
101
+ export const MetadataError = mod.MetadataError;
102
+ export const MetadataProvider = mod.MetadataProvider;
103
+ export const MetadataStorage = mod.MetadataStorage;
104
+ export const MetadataValidator = mod.MetadataValidator;
105
+ export const MikroORM = mod.MikroORM;
106
+ export const MongoNamingStrategy = mod.MongoNamingStrategy;
15
107
  export const MonkeyPatchable = mod.MonkeyPatchable;
108
+ export const NodeState = mod.NodeState;
109
+ export const NonUniqueFieldNameException = mod.NonUniqueFieldNameException;
110
+ export const NotFoundError = mod.NotFoundError;
111
+ export const NotNullConstraintViolationException = mod.NotNullConstraintViolationException;
112
+ export const NullCacheAdapter = mod.NullCacheAdapter;
113
+ export const NullHighlighter = mod.NullHighlighter;
114
+ export const ObjectBindingPattern = mod.ObjectBindingPattern;
16
115
  export const ObjectCriteriaNode = mod.ObjectCriteriaNode;
116
+ export const ObjectHydrator = mod.ObjectHydrator;
117
+ export const OnInit = mod.OnInit;
118
+ export const OnLoad = mod.OnLoad;
119
+ export const OneToMany = mod.OneToMany;
120
+ export const OneToOne = mod.OneToOne;
121
+ export const OptimisticLockError = mod.OptimisticLockError;
122
+ export const OptionalProps = mod.OptionalProps;
123
+ export const PlainObject = mod.PlainObject;
124
+ export const Platform = mod.Platform;
125
+ export const PopulateHint = mod.PopulateHint;
126
+ export const PrimaryKey = mod.PrimaryKey;
127
+ export const PrimaryKeyProp = mod.PrimaryKeyProp;
128
+ export const PrimaryKeyType = mod.PrimaryKeyType;
129
+ export const Property = mod.Property;
17
130
  export const QueryBuilder = mod.QueryBuilder;
18
131
  export const QueryBuilderHelper = mod.QueryBuilderHelper;
132
+ export const QueryFlag = mod.QueryFlag;
133
+ export const QueryHelper = mod.QueryHelper;
134
+ export const QueryOperator = mod.QueryOperator;
135
+ export const QueryOrder = mod.QueryOrder;
136
+ export const QueryOrderNumeric = mod.QueryOrderNumeric;
19
137
  export const QueryType = mod.QueryType;
138
+ export const ReadOnlyException = mod.ReadOnlyException;
139
+ export const Reference = mod.Reference;
140
+ export const ReferenceType = mod.ReferenceType;
141
+ export const ReflectMetadataProvider = mod.ReflectMetadataProvider;
142
+ export const RequestContext = mod.RequestContext;
143
+ export const SCALAR_TYPES = mod.SCALAR_TYPES;
20
144
  export const ScalarCriteriaNode = mod.ScalarCriteriaNode;
21
145
  export const SchemaComparator = mod.SchemaComparator;
22
146
  export const SchemaGenerator = mod.SchemaGenerator;
23
147
  export const SchemaHelper = mod.SchemaHelper;
148
+ export const SerializationContext = mod.SerializationContext;
149
+ export const SerializedPrimaryKey = mod.SerializedPrimaryKey;
150
+ export const ServerException = mod.ServerException;
151
+ export const SimpleLogger = mod.SimpleLogger;
152
+ export const SmallIntType = mod.SmallIntType;
24
153
  export const SqlEntityManager = mod.SqlEntityManager;
25
154
  export const SqlEntityRepository = mod.SqlEntityRepository;
155
+ export const SqlSchemaGenerator = mod.SqlSchemaGenerator;
156
+ export const StringType = mod.StringType;
157
+ export const Subscriber = mod.Subscriber;
158
+ export const SyntaxErrorException = mod.SyntaxErrorException;
159
+ export const TableExistsException = mod.TableExistsException;
160
+ export const TableNotFoundException = mod.TableNotFoundException;
161
+ export const TextType = mod.TextType;
162
+ export const TimeType = mod.TimeType;
163
+ export const TinyIntType = mod.TinyIntType;
164
+ export const TransactionContext = mod.TransactionContext;
165
+ export const TransactionEventBroadcaster = mod.TransactionEventBroadcaster;
166
+ export const Type = mod.Type;
167
+ export const UnderscoreNamingStrategy = mod.UnderscoreNamingStrategy;
168
+ export const Unique = mod.Unique;
169
+ export const UniqueConstraintViolationException = mod.UniqueConstraintViolationException;
170
+ export const UnitOfWork = mod.UnitOfWork;
171
+ export const UnknownType = mod.UnknownType;
172
+ export const UseRequestContext = mod.UseRequestContext;
173
+ export const Utils = mod.Utils;
174
+ export const UuidType = mod.UuidType;
175
+ export const ValidationError = mod.ValidationError;
176
+ export const WrappedEntity = mod.WrappedEntity;
177
+ export const assign = mod.assign;
178
+ export const colors = mod.colors;
179
+ export const compareArrays = mod.compareArrays;
180
+ export const compareBooleans = mod.compareBooleans;
181
+ export const compareBuffers = mod.compareBuffers;
182
+ export const compareObjects = mod.compareObjects;
183
+ export const defineConfig = mod.defineConfig;
184
+ export const equals = mod.equals;
185
+ export const expr = mod.expr;
186
+ export const helper = mod.helper;
26
187
  export const knex = mod.knex;
188
+ export const ref = mod.ref;
189
+ export const serialize = mod.serialize;
190
+ export const t = mod.t;
191
+ export const types = mod.types;
192
+ export const wrap = mod.wrap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.6",
3
+ "version": "6.0.0-dev.8",
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",
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^5.5.3"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~6.0.0-dev.6"
69
+ "@mikro-orm/core": "~6.0.0-dev.8"
70
70
  }
71
71
  }
@@ -1,6 +1,6 @@
1
1
  import type { Dictionary, EntityMetadata, EntityProperty, NamingStrategy } from '@mikro-orm/core';
2
2
  import type { SchemaHelper } from './SchemaHelper';
3
- import type { Check, Column, ForeignKey, Index } from '../typings';
3
+ import type { CheckDef, Column, ForeignKey, IndexDef } from '../typings';
4
4
  import type { AbstractSqlPlatform } from '../AbstractSqlPlatform';
5
5
  /**
6
6
  * @internal
@@ -17,9 +17,9 @@ export declare class DatabaseTable {
17
17
  constructor(platform: AbstractSqlPlatform, name: string, schema?: string | undefined);
18
18
  getColumns(): Column[];
19
19
  getColumn(name: string): Column | undefined;
20
- getIndexes(): Index[];
21
- getChecks(): Check[];
22
- init(cols: Column[], indexes: Index[] | undefined, checks: Check<unknown>[] | undefined, pks: string[], fks?: Dictionary<ForeignKey>, enums?: Dictionary<string[]>): void;
20
+ getIndexes(): IndexDef[];
21
+ getChecks(): CheckDef[];
22
+ init(cols: Column[], indexes: IndexDef[] | undefined, checks: CheckDef<unknown>[] | undefined, pks: string[], fks?: Dictionary<ForeignKey>, enums?: Dictionary<string[]>): void;
23
23
  addColumn(column: Column): void;
24
24
  addColumnFromProperty(prop: EntityProperty, meta: EntityMetadata): void;
25
25
  private getIndexName;
@@ -30,11 +30,11 @@ export declare class DatabaseTable {
30
30
  getShortestName(): string;
31
31
  getForeignKeys(): Dictionary<ForeignKey>;
32
32
  hasColumn(columnName: string): boolean;
33
- getIndex(indexName: string): Index | undefined;
33
+ getIndex(indexName: string): IndexDef | undefined;
34
34
  hasIndex(indexName: string): boolean;
35
- getCheck(checkName: string): Check<unknown> | undefined;
35
+ getCheck(checkName: string): CheckDef<unknown> | undefined;
36
36
  hasCheck(checkName: string): boolean;
37
- getPrimaryKey(): Index | undefined;
37
+ getPrimaryKey(): IndexDef | undefined;
38
38
  hasPrimaryKey(): boolean;
39
39
  private getPropertyDeclaration;
40
40
  private getReferenceType;
@@ -48,6 +48,6 @@ export declare class DatabaseTable {
48
48
  expression?: string;
49
49
  options?: Dictionary;
50
50
  }, type: 'index' | 'unique' | 'primary'): void;
51
- addCheck(check: Check): void;
51
+ addCheck(check: CheckDef): void;
52
52
  toJSON(): Dictionary;
53
53
  }
@@ -1,4 +1,4 @@
1
- import type { Check, Column, ForeignKey, Index, SchemaDifference, TableDifference } from '../typings';
1
+ import type { CheckDef, Column, ForeignKey, IndexDef, SchemaDifference, TableDifference } from '../typings';
2
2
  import type { DatabaseSchema } from './DatabaseSchema';
3
3
  import type { DatabaseTable } from './DatabaseTable';
4
4
  import type { AbstractSqlPlatform } from '../AbstractSqlPlatform';
@@ -45,12 +45,12 @@ export declare class SchemaComparator {
45
45
  * Finds the difference between the indexes index1 and index2.
46
46
  * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
47
47
  */
48
- diffIndex(index1: Index, index2: Index): boolean;
48
+ diffIndex(index1: IndexDef, index2: IndexDef): boolean;
49
49
  /**
50
50
  * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
51
51
  */
52
- isIndexFulfilledBy(index1: Index, index2: Index): boolean;
53
- diffCheck(check1: Check, check2: Check): boolean;
52
+ isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean;
53
+ diffCheck(check1: CheckDef, check2: CheckDef): boolean;
54
54
  hasSameDefaultValue(from: Column, to: Column): boolean;
55
55
  private mapColumnToProperty;
56
56
  private log;
@@ -2,7 +2,7 @@ import type { Knex } from 'knex';
2
2
  import type { Connection, Dictionary } from '@mikro-orm/core';
3
3
  import type { AbstractSqlConnection } from '../AbstractSqlConnection';
4
4
  import type { AbstractSqlPlatform } from '../AbstractSqlPlatform';
5
- import type { Check, Column, Index, Table, TableDifference } from '../typings';
5
+ import type { CheckDef, Column, IndexDef, Table, TableDifference } from '../typings';
6
6
  import type { DatabaseTable } from './DatabaseTable';
7
7
  import type { DatabaseSchema } from './DatabaseSchema';
8
8
  export declare abstract class SchemaHelper {
@@ -14,16 +14,16 @@ export declare abstract class SchemaHelper {
14
14
  getSchemaEnd(): string;
15
15
  finalizeTable(table: Knex.TableBuilder, charset: string, collate?: string): void;
16
16
  supportsSchemaConstraints(): boolean;
17
- getPrimaryKeys(connection: AbstractSqlConnection, indexes: Index[] | undefined, tableName: string, schemaName?: string): Promise<string[]>;
17
+ getPrimaryKeys(connection: AbstractSqlConnection, indexes: IndexDef[] | undefined, tableName: string, schemaName?: string): Promise<string[]>;
18
18
  getForeignKeys(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise<Dictionary>;
19
19
  protected getTableKey(t: Table): string;
20
- getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName?: string): Promise<Dictionary<string[]>>;
20
+ getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName?: string): Promise<Dictionary<string[]>>;
21
21
  loadInformationSchema(schema: DatabaseSchema, connection: AbstractSqlConnection, tables: Table[]): Promise<void>;
22
22
  getListTablesSQL(schemaName?: string): string;
23
23
  getRenameColumnSQL(tableName: string, oldColumnName: string, to: Column, schemaName?: string): string;
24
- getCreateIndexSQL(tableName: string, index: Index): string;
25
- getDropIndexSQL(tableName: string, index: Index): string;
26
- getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string;
24
+ getCreateIndexSQL(tableName: string, index: IndexDef): string;
25
+ getDropIndexSQL(tableName: string, index: IndexDef): string;
26
+ getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string;
27
27
  hasNonDefaultPrimaryKeyName(table: DatabaseTable): boolean;
28
28
  createTableColumn(table: Knex.TableBuilder, column: Column, fromTable: DatabaseTable, changedProperties?: Set<string>): Knex.ColumnBuilder;
29
29
  configureColumn(column: Column, col: Knex.ColumnBuilder, knex: Knex, changedProperties?: Set<string>): Knex.ColumnBuilder;
@@ -33,9 +33,9 @@ export declare abstract class SchemaHelper {
33
33
  getChangeColumnCommentSQL(tableName: string, to: Column): string;
34
34
  getNamespaces(connection: AbstractSqlConnection): Promise<string[]>;
35
35
  getColumns(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise<Column[]>;
36
- getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise<Index[]>;
37
- getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string, columns?: Column[]): Promise<Check[]>;
38
- protected mapIndexes(indexes: Index[]): Promise<Index[]>;
36
+ getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise<IndexDef[]>;
37
+ getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string, columns?: Column[]): Promise<CheckDef[]>;
38
+ protected mapIndexes(indexes: IndexDef[]): Promise<IndexDef[]>;
39
39
  getForeignKeysSQL(tableName: string, schemaName?: string): string;
40
40
  mapForeignKeys(fks: any[], tableName: string, schemaName?: string): Dictionary;
41
41
  normalizeDefaultValue(defaultValue: string, length?: number, defaultValues?: Dictionary<string[]>): string | number;
@@ -3,10 +3,7 @@ import { AbstractSchemaGenerator } from '@mikro-orm/core';
3
3
  import type { SchemaDifference } from '../typings';
4
4
  import { DatabaseSchema } from './DatabaseSchema';
5
5
  import type { AbstractSqlDriver } from '../AbstractSqlDriver';
6
- /**
7
- * Should be renamed to `SqlSchemaGenerator` in v6
8
- */
9
- export declare class SchemaGenerator extends AbstractSchemaGenerator<AbstractSqlDriver> implements ISchemaGenerator {
6
+ export declare class SqlSchemaGenerator extends AbstractSchemaGenerator<AbstractSqlDriver> implements ISchemaGenerator {
10
7
  private readonly helper;
11
8
  private readonly options;
12
9
  protected lastEnsuredDatabase?: string;
@@ -101,3 +98,4 @@ export declare class SchemaGenerator extends AbstractSchemaGenerator<AbstractSql
101
98
  private dump;
102
99
  private get knex();
103
100
  }
101
+ export { SqlSchemaGenerator as SchemaGenerator };
@@ -1,20 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaGenerator = void 0;
3
+ exports.SchemaGenerator = exports.SqlSchemaGenerator = void 0;
4
4
  const core_1 = require("@mikro-orm/core");
5
5
  const DatabaseSchema_1 = require("./DatabaseSchema");
6
6
  const SchemaComparator_1 = require("./SchemaComparator");
7
- /**
8
- * Should be renamed to `SqlSchemaGenerator` in v6
9
- */
10
- class SchemaGenerator extends core_1.AbstractSchemaGenerator {
7
+ class SqlSchemaGenerator extends core_1.AbstractSchemaGenerator {
11
8
  constructor() {
12
9
  super(...arguments);
13
10
  this.helper = this.platform.getSchemaHelper();
14
11
  this.options = this.config.get('schemaGenerator');
15
12
  }
16
13
  static register(orm) {
17
- orm.config.registerExtension('@mikro-orm/schema-generator', () => new SchemaGenerator(orm.em));
14
+ orm.config.registerExtension('@mikro-orm/schema-generator', () => new SqlSchemaGenerator(orm.em));
18
15
  }
19
16
  /** @deprecated use `dropSchema` and `createSchema` commands respectively */
20
17
  async generate() {
@@ -487,4 +484,5 @@ class SchemaGenerator extends core_1.AbstractSchemaGenerator {
487
484
  return this.connection.getKnex();
488
485
  }
489
486
  }
490
- exports.SchemaGenerator = SchemaGenerator;
487
+ exports.SqlSchemaGenerator = SqlSchemaGenerator;
488
+ exports.SchemaGenerator = SqlSchemaGenerator;
package/schema/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './DatabaseSchema';
2
2
  export * from './DatabaseTable';
3
- export * from './SchemaGenerator';
3
+ export * from './SqlSchemaGenerator';
4
4
  export * from './SchemaHelper';
5
5
  export * from './SchemaComparator';
package/schema/index.js CHANGED
@@ -16,6 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DatabaseSchema"), exports);
18
18
  __exportStar(require("./DatabaseTable"), exports);
19
- __exportStar(require("./SchemaGenerator"), exports);
19
+ __exportStar(require("./SqlSchemaGenerator"), exports);
20
20
  __exportStar(require("./SchemaHelper"), exports);
21
21
  __exportStar(require("./SchemaComparator"), exports);
package/typings.d.ts CHANGED
@@ -54,7 +54,7 @@ export interface ForeignKey {
54
54
  updateRule?: string;
55
55
  deleteRule?: string;
56
56
  }
57
- export interface Index {
57
+ export interface IndexDef {
58
58
  columnNames: string[];
59
59
  keyName: string;
60
60
  unique: boolean;
@@ -67,7 +67,7 @@ export interface Index {
67
67
  predicate?: Knex.QueryBuilder;
68
68
  }>;
69
69
  }
70
- export interface Check<T = unknown> {
70
+ export interface CheckDef<T = unknown> {
71
71
  name: string;
72
72
  expression: string | CheckCallback<T>;
73
73
  definition?: string;
@@ -88,13 +88,13 @@ export interface TableDifference {
88
88
  changedColumns: Dictionary<ColumnDifference>;
89
89
  removedColumns: Dictionary<Column>;
90
90
  renamedColumns: Dictionary<Column>;
91
- addedIndexes: Dictionary<Index>;
92
- changedIndexes: Dictionary<Index>;
93
- removedIndexes: Dictionary<Index>;
94
- renamedIndexes: Dictionary<Index>;
95
- addedChecks: Dictionary<Check>;
96
- changedChecks: Dictionary<Check>;
97
- removedChecks: Dictionary<Check>;
91
+ addedIndexes: Dictionary<IndexDef>;
92
+ changedIndexes: Dictionary<IndexDef>;
93
+ removedIndexes: Dictionary<IndexDef>;
94
+ renamedIndexes: Dictionary<IndexDef>;
95
+ addedChecks: Dictionary<CheckDef>;
96
+ changedChecks: Dictionary<CheckDef>;
97
+ removedChecks: Dictionary<CheckDef>;
98
98
  addedForeignKeys: Dictionary<ForeignKey>;
99
99
  changedForeignKeys: Dictionary<ForeignKey>;
100
100
  removedForeignKeys: Dictionary<ForeignKey>;