From 175c05912d3f53eac0788ecd32002cb9a30e7cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Sat, 3 Dec 2022 16:12:25 +0100 Subject: [PATCH] feat(core): re-export the core package from all drivers (#3816) Every driver now reexport the whole `@mikro-orm/core` package. This means we no longer have to think about what package to use for imports, the driver package should be always preferred. ```diff -import { Entity, PrimaryKey } from '@mikro-orm/core'; -import { MikroORM, EntityManager } from '@mikro-orm/mysql'; +import { Entity, PrimaryKey, MikroORM, EntityManager } from '@mikro-orm/mysql'; ``` --- docs/docs/upgrading-v5-to-v6.md | 10 ++++++++++ .../src/BetterSqliteSchemaHelper.ts | 12 ++++++------ .../src/commands/MigrationCommandFactory.ts | 16 ++++++++-------- packages/knex/src/index.ts | 1 + packages/knex/src/schema/DatabaseTable.ts | 14 +++++++------- packages/knex/src/schema/SchemaComparator.ts | 10 +++++----- packages/knex/src/schema/SchemaHelper.ts | 18 +++++++++--------- packages/knex/src/schema/SqlSchemaGenerator.ts | 10 +++++----- packages/knex/src/typings.ts | 18 +++++++++--------- packages/mariadb/src/MariaDbSchemaHelper.ts | 14 +++++++------- packages/mongodb/src/index.ts | 1 + packages/mysql/src/MySqlSchemaHelper.ts | 14 +++++++------- .../postgresql/src/PostgreSqlSchemaHelper.ts | 14 +++++++------- packages/sqlite/src/SqliteSchemaHelper.ts | 12 ++++++------ tests/issues/GH1003.test.ts | 5 ++--- tests/issues/GH1009.test.ts | 6 ++---- tests/issues/GH1038.test.ts | 6 ++---- tests/issues/GH1041.test.ts | 7 ++----- tests/issues/GH1111.test.ts | 7 ++----- tests/issues/GH1115.test.ts | 7 ++----- tests/issues/GH1124.test.ts | 6 ++---- tests/issues/GH1126.test.ts | 6 ++---- tests/issues/GH1128.test.ts | 7 ++----- tests/issues/GH1134.test.ts | 6 ++---- tests/issues/GH1143.test.ts | 6 ++---- tests/issues/GH1150.test.ts | 6 ++---- tests/issues/GH1171.test.ts | 7 ++----- tests/issues/GH1176.test.ts | 18 +++++------------- tests/issues/GH1224.test.ts | 7 ++----- tests/issues/GH1226.test.ts | 12 ++++-------- tests/issues/GH1231.test.ts | 6 ++---- tests/issues/GH1262.test.ts | 4 +--- tests/issues/GH1263.test.ts | 6 ++---- tests/issues/GH1278.test.ts | 6 ++---- tests/issues/GH1326.test.ts | 3 +-- tests/issues/GH1331.test.ts | 6 ++---- tests/issues/GH1334.test.ts | 6 ++---- tests/issues/GH1346.test.ts | 7 ++----- tests/issues/GH1352.test.ts | 6 ++---- tests/issues/GH1395.test.ts | 4 +--- tests/issues/GH1429.test.ts | 4 +--- tests/issues/GH1444.test.ts | 4 +--- tests/issues/GH1538.test.ts | 6 ++---- tests/issues/GH1553.test.ts | 6 ++---- tests/issues/GH1592.test.ts | 6 ++---- tests/issues/GH1595.test.ts | 4 +--- tests/issues/GH1616.test.ts | 4 +--- tests/issues/GH1626.test.ts | 7 ++----- tests/issues/GH1657.test.ts | 6 ++---- tests/issues/GH1664.test.ts | 6 ++---- tests/issues/GH1704.test.ts | 6 ++---- tests/issues/GH1721.test.ts | 6 ++---- tests/issues/GH1831.test.ts | 6 ++---- tests/issues/GH1882.test.ts | 6 ++---- tests/issues/GH1902.test.ts | 6 ++---- tests/issues/GH1910.test.ts | 8 +++----- tests/issues/GH1927.test.ts | 6 ++---- tests/issues/GH1958.test.ts | 4 +--- tests/issues/GH1968.test.ts | 4 +--- tests/issues/GH1990.test.ts | 4 +--- tests/issues/GH2059.test.ts | 6 ++---- tests/issues/GH2121.test.ts | 6 ++---- tests/issues/GH2148.test.ts | 6 ++---- tests/issues/GH222.test.ts | 7 ++----- tests/issues/GH2233.test.ts | 6 ++---- tests/issues/GH2238.test.ts | 6 ++---- tests/issues/GH2273.test.ts | 4 +--- tests/issues/GH228.test.ts | 6 ++---- tests/issues/GH2293.test.ts | 6 ++---- tests/issues/GH234.test.ts | 6 ++---- tests/issues/GH2371.test.ts | 6 ++---- tests/issues/GH2379.test.ts | 6 ++---- tests/issues/GH2393.test.ts | 4 +--- tests/issues/GH2395.test.ts | 6 ++---- tests/issues/GH2406.test.ts | 6 ++---- tests/issues/GH2410.test.ts | 6 ++---- tests/issues/GH2489.test.ts | 4 +--- tests/issues/GH2583.test.ts | 8 +++----- tests/issues/GH2647.test.ts | 4 +--- tests/issues/GH2648.test.ts | 6 ++---- tests/issues/GH2663.test.ts | 6 ++---- tests/issues/GH2675.test.ts | 6 ++---- tests/issues/GH2679.test.ts | 6 ++---- tests/issues/GH268.test.ts | 6 ++---- tests/issues/GH269.test.ts | 6 ++---- tests/issues/GH2703.test.ts | 6 ++---- tests/issues/GH2729.test.ts | 4 +--- tests/issues/GH2760.test.ts | 4 +--- tests/issues/GH2774.test.ts | 4 +--- tests/issues/GH2777.test.ts | 4 +--- tests/issues/GH2781.test.ts | 4 +--- tests/issues/GH2784.test.ts | 4 +--- tests/issues/GH2803.test.ts | 6 ++---- tests/issues/GH2806.test.ts | 4 +--- tests/issues/GH2810.test.ts | 4 +--- tests/issues/GH2815.test.ts | 6 ++---- tests/issues/GH2821.test.ts | 6 ++---- tests/issues/GH2829.test.ts | 6 ++---- tests/issues/GH2882.test.ts | 6 ++---- tests/issues/GH2886.test.ts | 4 +--- tests/issues/GH2973.test.ts | 4 +--- tests/issues/GH2974.test.ts | 4 +--- tests/issues/GH2990.test.ts | 4 +--- tests/issues/GH3005.test.ts | 8 +++----- tests/issues/GH302.test.ts | 6 ++---- tests/issues/GH3026.test.ts | 4 +--- tests/issues/GH3053.test.ts | 6 ++---- tests/issues/GH3054.test.ts | 6 ++---- tests/issues/GH3221.test.ts | 4 +--- tests/issues/GH3240.test.ts | 6 ++---- tests/issues/GH3269.test.ts | 4 +--- tests/issues/GH3271.test.ts | 3 +-- tests/issues/GH3287.test.ts | 4 +--- tests/issues/GH3292.test.ts | 2 +- tests/issues/GH3301.test.ts | 12 +++--------- tests/issues/GH3339.test.ts | 5 +---- tests/issues/GH3345.test.ts | 8 +++----- tests/issues/GH3354.test.ts | 6 ++---- tests/issues/GH3360.test.ts | 6 ++---- tests/issues/GH3429.test.ts | 6 ++---- tests/issues/GH349.test.ts | 3 +-- tests/issues/GH3490.test.ts | 6 ++---- tests/issues/GH3540.test.ts | 3 +-- tests/issues/GH3543.test.ts | 4 ++-- tests/issues/GH3548.test.ts | 3 +-- tests/issues/GH3564.test.ts | 4 +--- tests/issues/GH3576.test.ts | 3 +-- tests/issues/GH3603.test.ts | 3 +-- tests/issues/GH3614.test.ts | 3 +-- tests/issues/GH3666.test.ts | 3 +-- tests/issues/GH3669.test.ts | 3 +-- tests/issues/GH369.test.ts | 6 ++---- tests/issues/GH3694.test.ts | 3 +-- tests/issues/GH3696.test.ts | 3 +-- tests/issues/GH3737.test.ts | 4 +--- tests/issues/GH3738.test.ts | 7 ++++--- tests/issues/GH3739.test.ts | 3 +-- tests/issues/GH380.test.ts | 6 ++---- tests/issues/GH3810.test.ts | 3 +-- tests/issues/GH435.test.ts | 6 ++---- tests/issues/GH450.test.ts | 6 ++---- tests/issues/GH459.test.ts | 6 ++---- tests/issues/GH463.test.ts | 6 ++---- tests/issues/GH467.test.ts | 6 ++---- tests/issues/GH472.test.ts | 6 ++---- tests/issues/GH482.test.ts | 3 +-- tests/issues/GH486.test.ts | 6 ++---- tests/issues/GH493.test.ts | 6 ++---- tests/issues/GH519.test.ts | 6 ++---- tests/issues/GH529.test.ts | 6 ++---- tests/issues/GH533.test.ts | 6 ++---- tests/issues/GH535.test.ts | 6 ++---- tests/issues/GH557.test.ts | 6 ++---- tests/issues/GH560.test.ts | 6 ++---- tests/issues/GH572.test.ts | 6 ++---- tests/issues/GH589.test.ts | 6 ++---- tests/issues/GH603.test.ts | 3 +-- tests/issues/GH610.test.ts | 7 ++----- tests/issues/GH755.test.ts | 7 ++----- tests/issues/GH811.test.ts | 6 ++---- tests/issues/GH893.test.ts | 6 ++---- tests/issues/GH910.test.ts | 6 ++---- tests/issues/GH915.test.ts | 4 +--- tests/issues/GH940.test.ts | 6 ++---- tests/issues/GH949.test.ts | 6 ++---- tests/issues/GHx2.test.ts | 4 +--- 166 files changed, 353 insertions(+), 645 deletions(-) diff --git a/docs/docs/upgrading-v5-to-v6.md b/docs/docs/upgrading-v5-to-v6.md index 655cc161dd77..97742803e774 100644 --- a/docs/docs/upgrading-v5-to-v6.md +++ b/docs/docs/upgrading-v5-to-v6.md @@ -70,6 +70,16 @@ The options always needs to be plain JS object now. This was always only an inte Use the `connect` option instead. +## All drivers now re-export the `@mikro-orm/core` package + +This means we no longer have to think about what package to use for imports, the driver package should be always preferred. + +```diff +-import { Entity, PrimaryKey } from '@mikro-orm/core'; +-import { MikroORM, EntityManager } from '@mikro-orm/mysql'; ++import { Entity, PrimaryKey, MikroORM, EntityManager } from '@mikro-orm/mysql'; +``` + ## Removed `MongoDriver` methods - `createCollections` in favour of `orm.schema.createSchema()` diff --git a/packages/better-sqlite/src/BetterSqliteSchemaHelper.ts b/packages/better-sqlite/src/BetterSqliteSchemaHelper.ts index a15b9db41d07..e41da658541b 100644 --- a/packages/better-sqlite/src/BetterSqliteSchemaHelper.ts +++ b/packages/better-sqlite/src/BetterSqliteSchemaHelper.ts @@ -1,5 +1,5 @@ import type { Connection, Dictionary } from '@mikro-orm/core'; -import { SchemaHelper, type AbstractSqlConnection, type Index, type Check } from '@mikro-orm/knex'; +import { SchemaHelper, type AbstractSqlConnection, type IndexDef, type CheckDef } from '@mikro-orm/knex'; export class BetterSqliteSchemaHelper extends SchemaHelper { @@ -43,7 +43,7 @@ export class BetterSqliteSchemaHelper extends SchemaHelper { }); } - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName: string): Promise> { const sql = `select sql from sqlite_master where type = ? and name = ?`; const tableDefinition = await connection.execute<{ sql: string }>(sql, ['table', tableName], 'get'); @@ -62,18 +62,18 @@ export class BetterSqliteSchemaHelper extends SchemaHelper { }, {} as Dictionary); } - async getPrimaryKeys(connection: AbstractSqlConnection, indexes: Index[] = [], tableName: string, schemaName?: string): Promise { + async getPrimaryKeys(connection: AbstractSqlConnection, indexes: IndexDef[] = [], tableName: string, schemaName?: string): Promise { const sql = `pragma table_info(\`${tableName}\`)`; const cols = await connection.execute<{ pk: number; name: string }[]>(sql); return cols.filter(col => !!col.pk).map(col => col.name); } - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { const sql = `pragma table_info(\`${tableName}\`)`; const cols = await connection.execute<{ pk: number; name: string }[]>(sql); const indexes = await connection.execute(`pragma index_list(\`${tableName}\`)`); - const ret: Index[] = []; + const ret: IndexDef[] = []; for (const col of cols.filter(c => c.pk)) { ret.push({ @@ -97,7 +97,7 @@ export class BetterSqliteSchemaHelper extends SchemaHelper { return this.mapIndexes(ret); } - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { // Not supported at the moment. return []; } diff --git a/packages/cli/src/commands/MigrationCommandFactory.ts b/packages/cli/src/commands/MigrationCommandFactory.ts index fde849ddf7de..d577aa94dc1d 100644 --- a/packages/cli/src/commands/MigrationCommandFactory.ts +++ b/packages/cli/src/commands/MigrationCommandFactory.ts @@ -1,5 +1,5 @@ import type { ArgumentsCamelCase, Argv, CommandModule } from 'yargs'; -import { Utils, colors, type Configuration, type Dictionary, type MikroORM, type MikroORMOptions, type IMigrator, MigrateOptions } from '@mikro-orm/core'; +import { Utils, colors, type Configuration, type Dictionary, type MikroORM, type Options, type IMigrator, MigrateOptions } from '@mikro-orm/core'; import { CLIHelper } from '../CLIHelper'; export class MigrationCommandFactory { @@ -14,7 +14,7 @@ export class MigrationCommandFactory { fresh: 'Clear the database and rerun all migrations', }; - static create(command: MigratorMethod): CommandModule & { builder: (args: Argv) => Argv; handler: (args: ArgumentsCamelCase) => Promise } { + static create(command: MigratorMethod): CommandModule & { builder: (args: Argv) => Argv; handler: (args: ArgumentsCamelCase) => Promise } { return { command: `migration:${command}`, describe: MigrationCommandFactory.DESCRIPTIONS[command], @@ -85,9 +85,9 @@ export class MigrationCommandFactory { }); } - static async handleMigrationCommand(args: ArgumentsCamelCase, method: MigratorMethod): Promise { + static async handleMigrationCommand(args: ArgumentsCamelCase, method: MigratorMethod): Promise { // to be able to run have a master transaction, but run marked migrations outside of it, we need a second connection - const options = { pool: { min: 1, max: 2 } } as Partial; + const options = { pool: { min: 1, max: 2 } } as Options; const orm = await CLIHelper.getORM(undefined, options); const migrator = orm.getMigrator(); @@ -126,7 +126,7 @@ export class MigrationCommandFactory { }); } - private static async handleUpDownCommand(args: ArgumentsCamelCase, migrator: IMigrator, method: MigratorMethod) { + private static async handleUpDownCommand(args: ArgumentsCamelCase, migrator: IMigrator, method: MigratorMethod) { const opts = MigrationCommandFactory.getUpDownOptions(args); await migrator[method](opts as string[]); const message = this.getUpDownSuccessMessage(method as 'up' | 'down', opts); @@ -156,7 +156,7 @@ export class MigrationCommandFactory { }); } - private static async handleCreateCommand(migrator: IMigrator, args: ArgumentsCamelCase, config: Configuration): Promise { + private static async handleCreateCommand(migrator: IMigrator, args: ArgumentsCamelCase, config: Configuration): Promise { const ret = await migrator.createMigration(args.path, args.blank, args.initial, args.name); if (ret.diff.up.length === 0) { @@ -189,7 +189,7 @@ export class MigrationCommandFactory { process.exit(1); } - private static async handleFreshCommand(args: ArgumentsCamelCase, migrator: IMigrator, orm: MikroORM) { + private static async handleFreshCommand(args: ArgumentsCamelCase, migrator: IMigrator, orm: MikroORM) { const generator = orm.getSchemaGenerator(); await generator.dropSchema({ dropMigrationsTable: true, dropDb: args.dropDb }); CLIHelper.dump(colors.green('Dropped schema successfully')); @@ -250,4 +250,4 @@ export class MigrationCommandFactory { type MigratorMethod = 'create' | 'check' | 'up' | 'down' | 'list' | 'pending' | 'fresh'; type CliUpDownOptions = { to?: string | number; from?: string | number; only?: string }; type GenerateOptions = { dump?: boolean; blank?: boolean; initial?: boolean; path?: string; disableFkChecks?: boolean; seed: string; name?: string }; -type Options = GenerateOptions & CliUpDownOptions & { dropDb?: boolean }; +type Opts = GenerateOptions & CliUpDownOptions & { dropDb?: boolean }; diff --git a/packages/knex/src/index.ts b/packages/knex/src/index.ts index 03a57970826b..e017819e118c 100644 --- a/packages/knex/src/index.ts +++ b/packages/knex/src/index.ts @@ -17,3 +17,4 @@ export { SqlEntityRepository as EntityRepository } from './SqlEntityRepository'; /** @ignore */ export { Knex, knex } from 'knex'; +export * from '@mikro-orm/core'; diff --git a/packages/knex/src/schema/DatabaseTable.ts b/packages/knex/src/schema/DatabaseTable.ts index b488614ff14b..feb5afa935ff 100644 --- a/packages/knex/src/schema/DatabaseTable.ts +++ b/packages/knex/src/schema/DatabaseTable.ts @@ -1,6 +1,6 @@ import { Cascade, DateTimeType, DecimalType, EntitySchema, ReferenceType, t, Utils, type Dictionary, type EntityMetadata, type EntityProperty, type NamingStrategy } from '@mikro-orm/core'; import type { SchemaHelper } from './SchemaHelper'; -import type { Check, Column, ForeignKey, Index } from '../typings'; +import type { CheckDef, Column, ForeignKey, IndexDef } from '../typings'; import type { AbstractSqlPlatform } from '../AbstractSqlPlatform'; /** @@ -9,8 +9,8 @@ import type { AbstractSqlPlatform } from '../AbstractSqlPlatform'; export class DatabaseTable { private columns: Dictionary = {}; - private indexes: Index[] = []; - private checks: Check[] = []; + private indexes: IndexDef[] = []; + private checks: CheckDef[] = []; private foreignKeys: Dictionary = {}; public comment?: string; @@ -34,15 +34,15 @@ export class DatabaseTable { delete this.columns[name]; } - getIndexes(): Index[] { + getIndexes(): IndexDef[] { return this.indexes; } - getChecks(): Check[] { + getChecks(): CheckDef[] { return this.checks; } - init(cols: Column[], indexes: Index[] = [], checks: Check[] = [], pks: string[], fks: Dictionary = {}, enums: Dictionary = {}): void { + init(cols: Column[], indexes: IndexDef[] = [], checks: CheckDef[] = [], pks: string[], fks: Dictionary = {}, enums: Dictionary = {}): void { this.indexes = indexes; this.checks = checks; this.foreignKeys = fks; @@ -385,7 +385,7 @@ export class DatabaseTable { }); } - addCheck(check: Check) { + addCheck(check: CheckDef) { this.checks.push(check); } diff --git a/packages/knex/src/schema/SchemaComparator.ts b/packages/knex/src/schema/SchemaComparator.ts index 79b2d16f2506..fac2a6a12aca 100644 --- a/packages/knex/src/schema/SchemaComparator.ts +++ b/packages/knex/src/schema/SchemaComparator.ts @@ -9,7 +9,7 @@ import { type Dictionary, type EntityProperty, } from '@mikro-orm/core'; -import type { Check, Column, ForeignKey, Index, SchemaDifference, TableDifference } from '../typings'; +import type { CheckDef, Column, ForeignKey, IndexDef, SchemaDifference, TableDifference } from '../typings'; import type { DatabaseSchema } from './DatabaseSchema'; import type { DatabaseTable } from './DatabaseTable'; import type { AbstractSqlPlatform } from '../AbstractSqlPlatform'; @@ -340,7 +340,7 @@ export class SchemaComparator { * however ambiguities between different possibilities should not lead to renaming at all. */ private detectIndexRenamings(tableDifferences: TableDifference): void { - const renameCandidates: Dictionary<[Index, Index][]> = {}; + const renameCandidates: Dictionary<[IndexDef, IndexDef][]> = {}; // Gather possible rename candidates by comparing each added and removed index based on semantics. for (const addedIndex of Object.values(tableDifferences.addedIndexes)) { @@ -489,7 +489,7 @@ export class SchemaComparator { * Finds the difference between the indexes index1 and index2. * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences. */ - diffIndex(index1: Index, index2: Index): boolean { + diffIndex(index1: IndexDef, index2: IndexDef): boolean { // if one of them is a custom expression or full text index, compare only by name if (index1.expression || index2.expression || index1.type === 'fulltext' || index2.type === 'fulltext') { return index1.keyName !== index2.keyName; @@ -501,7 +501,7 @@ export class SchemaComparator { /** * Checks if the other index already fulfills all the indexing and constraint needs of the current one. */ - isIndexFulfilledBy(index1: Index, index2: Index): boolean { + isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean { // allow the other index to be equally large only. It being larger is an option but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo) if (index1.columnNames.length !== index2.columnNames.length) { return false; @@ -535,7 +535,7 @@ export class SchemaComparator { return index1.primary === index2.primary && index1.unique === index2.unique; } - diffCheck(check1: Check, check2: Check): boolean { + diffCheck(check1: CheckDef, check2: CheckDef): boolean { // check constraint definition might be normalized by the driver, // e.g. quotes might be added (https://github.com/mikro-orm/mikro-orm/issues/3827) const simplify = (str?: string) => str?.replace(/['"`()]/g, '').toLowerCase(); diff --git a/packages/knex/src/schema/SchemaHelper.ts b/packages/knex/src/schema/SchemaHelper.ts index 7e0536180c97..98c0bc41c08a 100644 --- a/packages/knex/src/schema/SchemaHelper.ts +++ b/packages/knex/src/schema/SchemaHelper.ts @@ -2,7 +2,7 @@ import type { Knex } from 'knex'; import { BigIntType, EnumType, Utils, type Connection, type Dictionary } from '@mikro-orm/core'; import type { AbstractSqlConnection } from '../AbstractSqlConnection'; import type { AbstractSqlPlatform } from '../AbstractSqlPlatform'; -import type { Check, Column, Index, Table, TableDifference } from '../typings'; +import type { CheckDef, Column, IndexDef, Table, TableDifference } from '../typings'; import type { DatabaseTable } from './DatabaseTable'; import type { DatabaseSchema } from './DatabaseSchema'; @@ -34,7 +34,7 @@ export abstract class SchemaHelper { return true; } - async getPrimaryKeys(connection: AbstractSqlConnection, indexes: Index[] = [], tableName: string, schemaName?: string): Promise { + async getPrimaryKeys(connection: AbstractSqlConnection, indexes: IndexDef[] = [], tableName: string, schemaName?: string): Promise { const pks = indexes.filter(i => i.primary).map(pk => pk.columnNames); return Utils.flatten(pks); } @@ -59,7 +59,7 @@ export abstract class SchemaHelper { return unquote(t.table_name); } - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName?: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName?: string): Promise> { return {}; } @@ -92,7 +92,7 @@ export abstract class SchemaHelper { return `alter table ${tableReference} rename column ${oldColumnName} to ${columnName}`; } - getCreateIndexSQL(tableName: string, index: Index): string { + getCreateIndexSQL(tableName: string, index: IndexDef): string { /* istanbul ignore if */ if (index.expression) { return index.expression; @@ -104,11 +104,11 @@ export abstract class SchemaHelper { return `create index ${keyName} on ${tableName} (${index.columnNames.map(c => this.platform.quoteIdentifier(c)).join(', ')})`; } - getDropIndexSQL(tableName: string, index: Index): string { + getDropIndexSQL(tableName: string, index: IndexDef): string { return `drop index ${this.platform.quoteIdentifier(index.keyName)}`; } - getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string { + getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string { return [this.getDropIndexSQL(tableName, { ...index, keyName: oldIndexName }), this.getCreateIndexSQL(tableName, index)].join(';\n'); } @@ -188,15 +188,15 @@ export abstract class SchemaHelper { throw new Error('Not supported by given driver'); } - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { throw new Error('Not supported by given driver'); } - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string, columns?: Column[]): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string, columns?: Column[]): Promise { throw new Error('Not supported by given driver'); } - protected async mapIndexes(indexes: Index[]): Promise { + protected async mapIndexes(indexes: IndexDef[]): Promise { const map = {} as Dictionary; indexes.forEach(index => { diff --git a/packages/knex/src/schema/SqlSchemaGenerator.ts b/packages/knex/src/schema/SqlSchemaGenerator.ts index 832f1ce0b45f..c5056f2135cb 100644 --- a/packages/knex/src/schema/SqlSchemaGenerator.ts +++ b/packages/knex/src/schema/SqlSchemaGenerator.ts @@ -1,6 +1,6 @@ import type { Knex } from 'knex'; import { AbstractSchemaGenerator, Utils, type Dictionary, type EntityMetadata, type MikroORM, ISchemaGenerator } from '@mikro-orm/core'; -import type { Check, ForeignKey, Index, SchemaDifference, TableDifference } from '../typings'; +import type { CheckDef, ForeignKey, IndexDef, SchemaDifference, TableDifference } from '../typings'; import { DatabaseSchema } from './DatabaseSchema'; import type { DatabaseTable } from './DatabaseTable'; import type { AbstractSqlDriver } from '../AbstractSqlDriver'; @@ -523,7 +523,7 @@ export class SqlSchemaGenerator extends AbstractSchemaGenerator; // for back compatibility mainly, to allow using knex's `index.type` option (e.g. gin index) } -export interface Check { +export interface CheckDef { name: string; expression: string | CheckCallback; definition?: string; @@ -99,13 +99,13 @@ export interface TableDifference { changedColumns: Dictionary; removedColumns: Dictionary; renamedColumns: Dictionary; - addedIndexes: Dictionary; - changedIndexes: Dictionary; - removedIndexes: Dictionary; - renamedIndexes: Dictionary; - addedChecks: Dictionary; - changedChecks: Dictionary; - removedChecks: Dictionary; + addedIndexes: Dictionary; + changedIndexes: Dictionary; + removedIndexes: Dictionary; + renamedIndexes: Dictionary; + addedChecks: Dictionary; + changedChecks: Dictionary; + removedChecks: Dictionary; addedForeignKeys: Dictionary; changedForeignKeys: Dictionary; removedForeignKeys: Dictionary; diff --git a/packages/mariadb/src/MariaDbSchemaHelper.ts b/packages/mariadb/src/MariaDbSchemaHelper.ts index eb98d554f7ff..b6e969f3b5ac 100644 --- a/packages/mariadb/src/MariaDbSchemaHelper.ts +++ b/packages/mariadb/src/MariaDbSchemaHelper.ts @@ -1,4 +1,4 @@ -import { SchemaHelper, type AbstractSqlConnection, type Check, type Column, type Index, type Knex, type TableDifference, type DatabaseTable, type DatabaseSchema, type Table, type ForeignKey } from '@mikro-orm/knex'; +import { SchemaHelper, type AbstractSqlConnection, type CheckDef, type Column, type IndexDef, type Knex, type TableDifference, type DatabaseTable, type DatabaseSchema, type Table, type ForeignKey } from '@mikro-orm/knex'; import { MediumIntType, type Dictionary, type Type } from '@mikro-orm/core'; /* istanbul ignore next */ @@ -54,7 +54,7 @@ export class MariaDbSchemaHelper extends SchemaHelper { } } - async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { + async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { const sql = `select table_name as table_name, nullif(table_schema, schema()) as schema_name, index_name as index_name, non_unique as non_unique, column_name as column_name from information_schema.statistics where table_schema = database() and table_name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(', ')})`; @@ -128,7 +128,7 @@ export class MariaDbSchemaHelper extends SchemaHelper { return ret; } - async getAllChecks(connection: AbstractSqlConnection, tables: Table[], columns?: Dictionary): Promise> { + async getAllChecks(connection: AbstractSqlConnection, tables: Table[], columns?: Dictionary): Promise> { const sql = this.getChecksSQL(tables); const allChecks = await connection.execute<{ name: string; column_name: string; schema_name: string; table_name: string; expression: string }[]>(sql); const ret = {}; @@ -230,7 +230,7 @@ export class MariaDbSchemaHelper extends SchemaHelper { return `alter table ${tableName} change ${oldColumnName} ${columnName} ${this.getColumnDeclarationSQL(to)}`; } - getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string { + getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string { tableName = this.platform.quoteIdentifier(tableName); oldIndexName = this.platform.quoteIdentifier(oldIndexName); const keyName = this.platform.quoteIdentifier(index.keyName); @@ -293,12 +293,12 @@ export class MariaDbSchemaHelper extends SchemaHelper { order by tc.constraint_name`; } - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { const res = await this.getAllChecks(connection, [{ table_name: tableName, schema_name: schemaName }], { [tableName]: columns! }); return res[tableName]; } - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName?: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName?: string): Promise> { const res = await this.getAllEnumDefinitions(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } @@ -308,7 +308,7 @@ export class MariaDbSchemaHelper extends SchemaHelper { return res[tableName]; } - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { const res = await this.getAllIndexes(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } diff --git a/packages/mongodb/src/index.ts b/packages/mongodb/src/index.ts index 6f6e1dcdb20e..6d20568dbd48 100644 --- a/packages/mongodb/src/index.ts +++ b/packages/mongodb/src/index.ts @@ -13,3 +13,4 @@ export { defineMongoConfig as defineConfig, } from './MongoMikroORM'; export { ObjectId } from 'bson'; +export * from '@mikro-orm/core'; diff --git a/packages/mysql/src/MySqlSchemaHelper.ts b/packages/mysql/src/MySqlSchemaHelper.ts index ff0389a8700a..34fa6df3eb5c 100644 --- a/packages/mysql/src/MySqlSchemaHelper.ts +++ b/packages/mysql/src/MySqlSchemaHelper.ts @@ -1,4 +1,4 @@ -import { SchemaHelper, type AbstractSqlConnection, type Check, type Column, type Index, type Knex, type TableDifference, type DatabaseTable, type DatabaseSchema, type Table, type ForeignKey } from '@mikro-orm/knex'; +import { SchemaHelper, type AbstractSqlConnection, type CheckDef, type Column, type IndexDef, type Knex, type TableDifference, type DatabaseTable, type DatabaseSchema, type Table, type ForeignKey } from '@mikro-orm/knex'; import { EnumType, StringType, TextType, MediumIntType, type Dictionary, type Type } from '@mikro-orm/core'; export class MySqlSchemaHelper extends SchemaHelper { @@ -55,7 +55,7 @@ export class MySqlSchemaHelper extends SchemaHelper { } } - async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { + async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { const sql = `select table_name as table_name, nullif(table_schema, schema()) as schema_name, index_name as index_name, non_unique as non_unique, column_name as column_name from information_schema.statistics where table_schema = database() and table_name in (${tables.map(t => this.platform.quoteValue(t.table_name)).join(', ')})`; @@ -127,7 +127,7 @@ export class MySqlSchemaHelper extends SchemaHelper { return ret; } - async getAllChecks(connection: AbstractSqlConnection, tables: Table[]): Promise> { + async getAllChecks(connection: AbstractSqlConnection, tables: Table[]): Promise> { /* istanbul ignore next */ if (!await this.supportsCheckConstraints(connection)) { return {}; @@ -211,7 +211,7 @@ export class MySqlSchemaHelper extends SchemaHelper { return `alter table ${tableName} change ${oldColumnName} ${columnName} ${this.getColumnDeclarationSQL(to)}`; } - getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string { + getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string { tableName = this.platform.quoteIdentifier(tableName); oldIndexName = this.platform.quoteIdentifier(oldIndexName); const keyName = this.platform.quoteIdentifier(index.keyName); @@ -303,13 +303,13 @@ export class MySqlSchemaHelper extends SchemaHelper { } /* istanbul ignore next */ - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { const res = await this.getAllChecks(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } /* istanbul ignore next */ - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName?: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName?: string): Promise> { const res = await this.getAllEnumDefinitions(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } @@ -321,7 +321,7 @@ export class MySqlSchemaHelper extends SchemaHelper { } /* istanbul ignore next */ - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { const res = await this.getAllIndexes(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } diff --git a/packages/postgresql/src/PostgreSqlSchemaHelper.ts b/packages/postgresql/src/PostgreSqlSchemaHelper.ts index 74ab80651d51..36ce283177a4 100644 --- a/packages/postgresql/src/PostgreSqlSchemaHelper.ts +++ b/packages/postgresql/src/PostgreSqlSchemaHelper.ts @@ -1,5 +1,5 @@ import { BigIntType, EnumType, Utils, type Dictionary } from '@mikro-orm/core'; -import { SchemaHelper, type AbstractSqlConnection, type Check, type Column, type DatabaseSchema, type DatabaseTable, type ForeignKey, type Index, type Table, type TableDifference, type Knex } from '@mikro-orm/knex'; +import { SchemaHelper, type AbstractSqlConnection, type CheckDef, type Column, type DatabaseSchema, type DatabaseTable, type ForeignKey, type IndexDef, type Table, type TableDifference, type Knex } from '@mikro-orm/knex'; export class PostgreSqlSchemaHelper extends SchemaHelper { @@ -73,7 +73,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { } } - async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { + async getAllIndexes(connection: AbstractSqlConnection, tables: Table[]): Promise> { const sql = this.getIndexesSQL(tables); const unquote = (str: string) => str.replace(/['"`]/g, ''); const allIndexes = await connection.execute(sql); @@ -137,7 +137,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { return ret; } - async getAllChecks(connection: AbstractSqlConnection, tables: Table[]): Promise> { + async getAllChecks(connection: AbstractSqlConnection, tables: Table[]): Promise> { const sql = this.getChecksSQL(tables); const allChecks = await connection.execute<{ name: string; column_name: string; schema_name: string; table_name: string; expression: string }[]>(sql); const ret = {}; @@ -194,7 +194,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { return ret; } - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName?: string, schemaName?: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName?: string, schemaName?: string): Promise> { const found: number[] = []; const enums = checks.reduce((o, item, index) => { // check constraints are defined as one of: @@ -360,7 +360,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { return `set session_replication_role = 'origin';`; } - getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string { + getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string { oldIndexName = this.platform.quoteIdentifier(oldIndexName); const keyName = this.platform.quoteIdentifier(index.keyName); @@ -392,7 +392,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { } /* istanbul ignore next */ - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise { const res = await this.getAllChecks(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } @@ -404,7 +404,7 @@ export class PostgreSqlSchemaHelper extends SchemaHelper { } /* istanbul ignore next */ - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { const res = await this.getAllIndexes(connection, [{ table_name: tableName, schema_name: schemaName }]); return res[tableName]; } diff --git a/packages/sqlite/src/SqliteSchemaHelper.ts b/packages/sqlite/src/SqliteSchemaHelper.ts index e761b002c2c7..734af5915a5c 100644 --- a/packages/sqlite/src/SqliteSchemaHelper.ts +++ b/packages/sqlite/src/SqliteSchemaHelper.ts @@ -1,5 +1,5 @@ import type { Connection, Dictionary } from '@mikro-orm/core'; -import { SchemaHelper, type AbstractSqlConnection, type Index, type Check } from '@mikro-orm/knex'; +import { SchemaHelper, type AbstractSqlConnection, type IndexDef, type CheckDef } from '@mikro-orm/knex'; export class SqliteSchemaHelper extends SchemaHelper { @@ -43,7 +43,7 @@ export class SqliteSchemaHelper extends SchemaHelper { }); } - async getEnumDefinitions(connection: AbstractSqlConnection, checks: Check[], tableName: string, schemaName: string): Promise> { + async getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName: string): Promise> { const sql = `select sql from sqlite_master where type = ? and name = ?`; const tableDefinition = await connection.execute<{ sql: string }>(sql, ['table', tableName], 'get'); @@ -62,18 +62,18 @@ export class SqliteSchemaHelper extends SchemaHelper { }, {} as Dictionary); } - async getPrimaryKeys(connection: AbstractSqlConnection, indexes: Index[], tableName: string, schemaName?: string): Promise { + async getPrimaryKeys(connection: AbstractSqlConnection, indexes: IndexDef[], tableName: string, schemaName?: string): Promise { const sql = `pragma table_info(\`${tableName}\`)`; const cols = await connection.execute<{ pk: number; name: string }[]>(sql); return cols.filter(col => !!col.pk).map(col => col.name); } - async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getIndexes(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { const sql = `pragma table_info(\`${tableName}\`)`; const cols = await connection.execute<{ pk: number; name: string }[]>(sql); const indexes = await connection.execute(`pragma index_list(\`${tableName}\`)`); - const ret: Index[] = []; + const ret: IndexDef[] = []; for (const col of cols.filter(c => c.pk)) { ret.push({ @@ -97,7 +97,7 @@ export class SqliteSchemaHelper extends SchemaHelper { return this.mapIndexes(ret); } - async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { + async getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise { // Not supported at the moment. return []; } diff --git a/tests/issues/GH1003.test.ts b/tests/issues/GH1003.test.ts index c274fa71eb00..753053f4b5d4 100644 --- a/tests/issues/GH1003.test.ts +++ b/tests/issues/GH1003.test.ts @@ -1,6 +1,5 @@ -import type { IdentifiedReference } from '@mikro-orm/core'; -import { BaseEntity, Collection, Entity, ManyToOne, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +import { BaseEntity, Collection, MikroORM, Entity, ManyToOne, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; +import type { IdentifiedReference } from '@mikro-orm/sqlite'; @Entity() export class Parent extends BaseEntity { diff --git a/tests/issues/GH1009.test.ts b/tests/issues/GH1009.test.ts index 4b6377cc58a2..6a4ed731d255 100644 --- a/tests/issues/GH1009.test.ts +++ b/tests/issues/GH1009.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity({ tableName: 'brands' }) export class Brand { @@ -73,13 +72,12 @@ export class Site { describe('GH issue 1009', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [BrandSiteRestriction, Site, Brand, Publisher, Placement], dbName: `:memory:`, - driver: SqliteDriver, }); const generator = orm.schema; diff --git a/tests/issues/GH1038.test.ts b/tests/issues/GH1038.test.ts index d7a8b7219785..2553449f9952 100644 --- a/tests/issues/GH1038.test.ts +++ b/tests/issues/GH1038.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity({ abstract: true }) abstract class BaseEntity { @@ -57,13 +56,12 @@ class PositionBookmark extends BaseEntity { describe('GH issue 1038', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [BaseEntity, User, Position, PositionBookmark], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1041.test.ts b/tests/issues/GH1041.test.ts index 54de721b744f..f701566c1028 100644 --- a/tests/issues/GH1041.test.ts +++ b/tests/issues/GH1041.test.ts @@ -1,7 +1,5 @@ -import { Collection, Entity, LoadStrategy, ManyToMany, MikroORM, PopulateHint, PrimaryKey, Property } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; +import { Collection, Entity, LoadStrategy, ManyToMany, MikroORM, PopulateHint, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class App { @@ -33,14 +31,13 @@ export class User { describe('GH issue 1041, 1043', () => { - let orm: MikroORM; + let orm: MikroORM; const log = jest.fn(); beforeAll(async () => { orm = await MikroORM.init({ entities: [User, App], dbName: ':memory:', - driver: SqliteDriver, }); mockLogger(orm, ['query', 'query-params'], log); await orm.schema.createSchema(); diff --git a/tests/issues/GH1111.test.ts b/tests/issues/GH1111.test.ts index 907b3fd75b7b..4a39cdc10ded 100644 --- a/tests/issues/GH1111.test.ts +++ b/tests/issues/GH1111.test.ts @@ -1,7 +1,5 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType, Property, Reference } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; +import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType, Property, Reference } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; @Entity() class Node { @@ -44,14 +42,13 @@ class B { describe('GH issue 1111', () => { - let orm: MikroORM; + let orm: MikroORM; const log = jest.fn(); beforeAll(async () => { orm = await MikroORM.init({ entities: [Node, A, B], dbName: `mikro_orm_test_gh_1111`, - driver: PostgreSqlDriver, cache: { enabled: false }, }); mockLogger(orm, ['query', 'query-params'], log); diff --git a/tests/issues/GH1115.test.ts b/tests/issues/GH1115.test.ts index 6936a0eaff98..dd91f3c73f29 100644 --- a/tests/issues/GH1115.test.ts +++ b/tests/issues/GH1115.test.ts @@ -1,6 +1,4 @@ -import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class B { @@ -26,13 +24,12 @@ export class A { describe('GH issue 1115', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1124.test.ts b/tests/issues/GH1124.test.ts index 1d0b31b479e6..41d6c14da460 100644 --- a/tests/issues/GH1124.test.ts +++ b/tests/issues/GH1124.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class B { @@ -22,13 +21,12 @@ export class A { describe('GH issue 1124', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1126.test.ts b/tests/issues/GH1126.test.ts index a2a51dbe609a..a82638f357be 100644 --- a/tests/issues/GH1126.test.ts +++ b/tests/issues/GH1126.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -80,11 +79,10 @@ async function createEntities(orm: MikroORM) { describe('GH issue 1126', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Author, Book, Page], loadStrategy: LoadStrategy.JOINED, diff --git a/tests/issues/GH1128.test.ts b/tests/issues/GH1128.test.ts index eae7d7da6d1e..3fe2ad0d94ed 100644 --- a/tests/issues/GH1128.test.ts +++ b/tests/issues/GH1128.test.ts @@ -1,6 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class B { @@ -26,13 +24,12 @@ export class A { describe('GH issue 1128', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1134.test.ts b/tests/issues/GH1134.test.ts index bd93cf746012..8a75c089d3c5 100644 --- a/tests/issues/GH1134.test.ts +++ b/tests/issues/GH1134.test.ts @@ -1,6 +1,5 @@ -import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; +import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { v4 } from 'uuid'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -113,13 +112,12 @@ async function createEntities(orm: MikroORM) { describe('GH issue 1134', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [E, T, A, V, I, N, M], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); await createEntities(orm); diff --git a/tests/issues/GH1143.test.ts b/tests/issues/GH1143.test.ts index 2d07b6a4fba0..6a62224f97e0 100644 --- a/tests/issues/GH1143.test.ts +++ b/tests/issues/GH1143.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity({ tableName: 'test.DEVICES', @@ -16,13 +15,12 @@ export class Device { describe('GH issue 1143', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Device], dbName: `mikro_orm_test_gh_1143`, - driver: PostgreSqlDriver, }); const generator = orm.schema; diff --git a/tests/issues/GH1150.test.ts b/tests/issues/GH1150.test.ts index 59a17e1a1eff..7ffc31e9d365 100644 --- a/tests/issues/GH1150.test.ts +++ b/tests/issues/GH1150.test.ts @@ -1,5 +1,4 @@ -import { Entity, Enum, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, Enum, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity() export class Person { @@ -49,13 +48,12 @@ export class User { describe('GH issue 1150', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, Person], dbName: `mikro_orm_test_gh_1150`, - driver: PostgreSqlDriver, }); const generator = orm.schema; diff --git a/tests/issues/GH1171.test.ts b/tests/issues/GH1171.test.ts index f1b4c4320b73..983d17ef8e32 100644 --- a/tests/issues/GH1171.test.ts +++ b/tests/issues/GH1171.test.ts @@ -1,7 +1,5 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; +import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { v4 } from 'uuid'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class B { @@ -26,13 +24,12 @@ export class A { } describe('GH issue 1171', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1176.test.ts b/tests/issues/GH1176.test.ts index 975edf18a982..7d842257163f 100644 --- a/tests/issues/GH1176.test.ts +++ b/tests/issues/GH1176.test.ts @@ -1,12 +1,5 @@ -import type { - EntityManager } from '@mikro-orm/core'; -import { - Entity, - MikroORM, - PrimaryKey, - Property, -} from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import type { EntityManager } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; import { v4 as uuid } from 'uuid'; @Entity({ tableName: 'users' }) @@ -24,18 +17,17 @@ class User { } -async function getOrmInstance(): Promise> { +async function getOrmInstance(): Promise { const orm = await MikroORM.init({ entities: [User], dbName: 'mikro_orm_test_gh_1176', - driver: PostgreSqlDriver, }); - return orm as MikroORM; + return orm as MikroORM; } describe('GH issue 1176', () => { - let orm: MikroORM; + let orm: MikroORM; let em: EntityManager; beforeAll(async () => { diff --git a/tests/issues/GH1224.test.ts b/tests/issues/GH1224.test.ts index c1bc86d88540..f7e978d52805 100644 --- a/tests/issues/GH1224.test.ts +++ b/tests/issues/GH1224.test.ts @@ -1,7 +1,5 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType, Property, Reference } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; +import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType, Property, Reference } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; @Entity() class Node { @@ -41,14 +39,13 @@ class A { describe('GH issue 1224', () => { - let orm: MikroORM; + let orm: MikroORM; const log = jest.fn(); beforeAll(async () => { orm = await MikroORM.init({ entities: [Node, A, B], dbName: `mikro_orm_test_gh_1224`, - driver: PostgreSqlDriver, cache: { enabled: false }, }); mockLogger(orm, ['query', 'query-params'], log); diff --git a/tests/issues/GH1226.test.ts b/tests/issues/GH1226.test.ts index 48ef7458c6c3..43d1c5fb7bf5 100644 --- a/tests/issues/GH1226.test.ts +++ b/tests/issues/GH1226.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Example { @@ -21,25 +20,22 @@ export class Example { describe('GH issue 1226', () => { - let orm1: MikroORM; - let orm2: MikroORM; - let orm3: MikroORM; + let orm1: MikroORM; + let orm2: MikroORM; + let orm3: MikroORM; beforeAll(async () => { orm1 = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', forceEntityConstructor: true, entities: [Example], }); orm2 = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', forceEntityConstructor: [Example], entities: [Example], }); orm3 = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', forceEntityConstructor: ['Example'], entities: [Example], diff --git a/tests/issues/GH1231.test.ts b/tests/issues/GH1231.test.ts index 664092e5e1e7..ab20a2bb5b49 100644 --- a/tests/issues/GH1231.test.ts +++ b/tests/issues/GH1231.test.ts @@ -1,5 +1,4 @@ -import { Cascade, Collection, Entity, EntityRepositoryType, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { EntityRepository, PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Cascade, Collection, Entity, EntityRepository, EntityRepositoryType, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity({ tableName: 'teachers', repository: () => TeacherRepository }) class Teacher { @@ -67,13 +66,12 @@ class TeacherRepository extends EntityRepository { } describe('one to many relations read with query builder in postgresql (GH issue 1231)', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Teacher, Student], dbName: 'mikro_orm_test_1231', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH1262.test.ts b/tests/issues/GH1262.test.ts index 9ab6b4cdccf3..3c4eedb34105 100644 --- a/tests/issues/GH1262.test.ts +++ b/tests/issues/GH1262.test.ts @@ -1,8 +1,7 @@ import 'reflect-metadata'; -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { remove } from 'fs-extra'; import { TEMP_DIR } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity({ tableName: 'user' }) class UserBefore { @@ -42,7 +41,6 @@ describe('GH issue 1262', () => { async function createAndRunMigration(entities: any[]) { const db = await MikroORM.init({ - driver: SqliteDriver, entities, dbName: TEMP_DIR + '/gh_1262.db', }); diff --git a/tests/issues/GH1263.test.ts b/tests/issues/GH1263.test.ts index d96e4f0afc74..610a67ff118c 100644 --- a/tests/issues/GH1263.test.ts +++ b/tests/issues/GH1263.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/sqlite'; import { parse, stringify, v4 as uuid } from 'uuid'; class UUID extends Type { @@ -32,13 +31,12 @@ class User { describe('GH issue 1263', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1278.test.ts b/tests/issues/GH1278.test.ts index dd181aa81408..1457ebff1764 100644 --- a/tests/issues/GH1278.test.ts +++ b/tests/issues/GH1278.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -29,11 +28,10 @@ export class Group { describe('GH issue 1278', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Group, GroupCode], }); diff --git a/tests/issues/GH1326.test.ts b/tests/issues/GH1326.test.ts index 6664ff9250ce..e96519a64ece 100644 --- a/tests/issues/GH1326.test.ts +++ b/tests/issues/GH1326.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/mysql'; +import { Collection, Entity, IdentifiedReference, MikroORM, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/mysql'; import { mockLogger } from '../helpers'; @Entity() diff --git a/tests/issues/GH1331.test.ts b/tests/issues/GH1331.test.ts index 5904aaebc863..32cee1f22c2d 100644 --- a/tests/issues/GH1331.test.ts +++ b/tests/issues/GH1331.test.ts @@ -10,8 +10,7 @@ import { PrimaryKey, Property, QueryOrder, -} from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +} from '@mikro-orm/sqlite'; @Entity() export class D { @@ -109,11 +108,10 @@ export class A { describe('GH issue 1331', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [A, B, C, D], loadStrategy: LoadStrategy.JOINED, diff --git a/tests/issues/GH1334.test.ts b/tests/issues/GH1334.test.ts index 1c3d40820366..50c2f59a30e5 100644 --- a/tests/issues/GH1334.test.ts +++ b/tests/issues/GH1334.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, QueryOrder } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, IdentifiedReference, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, QueryOrder } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -77,11 +76,10 @@ export class Project { describe('GH issue 1334', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Project, Radio, RadioOption], loadStrategy: LoadStrategy.JOINED, diff --git a/tests/issues/GH1346.test.ts b/tests/issues/GH1346.test.ts index 7642b4480a1b..85c3beffdd24 100644 --- a/tests/issues/GH1346.test.ts +++ b/tests/issues/GH1346.test.ts @@ -1,6 +1,4 @@ -import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity({ tableName: 'name' }) class Name { @@ -33,13 +31,12 @@ class User { describe('GH issue 1346', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, Name], dbName: `mikro_orm_test_pivot_fields`, - driver: PostgreSqlDriver, }); await orm.schema.ensureDatabase(); diff --git a/tests/issues/GH1352.test.ts b/tests/issues/GH1352.test.ts index 115ee4e17aac..9842edd7aa95 100644 --- a/tests/issues/GH1352.test.ts +++ b/tests/issues/GH1352.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, IdentifiedReference, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Manager { @@ -81,11 +80,10 @@ export class Project { describe('GH issue 1352', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Project, Owner, Risk, Manager], loadStrategy: LoadStrategy.JOINED, diff --git a/tests/issues/GH1395.test.ts b/tests/issues/GH1395.test.ts index 9ac42b2d6319..0c6cb74675a0 100644 --- a/tests/issues/GH1395.test.ts +++ b/tests/issues/GH1395.test.ts @@ -1,6 +1,4 @@ -import { ObjectId } from 'bson'; -import { Entity, PrimaryKey, Property, t, wrap } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/mongodb'; +import { Entity, MikroORM, PrimaryKey, Property, t, wrap, ObjectId } from '@mikro-orm/mongodb'; export interface EmailMessageTest { html?: string; diff --git a/tests/issues/GH1429.test.ts b/tests/issues/GH1429.test.ts index b5865da8d556..0e40be9b0a2d 100644 --- a/tests/issues/GH1429.test.ts +++ b/tests/issues/GH1429.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() class A { @@ -27,7 +26,6 @@ describe('GH issue 1429', () => { orm = await MikroORM.init({ entities: [A], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1444.test.ts b/tests/issues/GH1444.test.ts index 2c931660ce3d..364b2104426c 100644 --- a/tests/issues/GH1444.test.ts +++ b/tests/issues/GH1444.test.ts @@ -1,6 +1,5 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { v4 as uuid } from 'uuid'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() class A { @@ -28,7 +27,6 @@ describe('GH issue 1444', () => { orm = await MikroORM.init({ entities: [A], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1538.test.ts b/tests/issues/GH1538.test.ts index 6f248839711a..6e49ba4d2568 100644 --- a/tests/issues/GH1538.test.ts +++ b/tests/issues/GH1538.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Author { @@ -39,13 +38,12 @@ export class Post { describe('GH issue 1538', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Author, Post], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1553.test.ts b/tests/issues/GH1553.test.ts index cadd2e6c9845..c4fa608bee1e 100644 --- a/tests/issues/GH1553.test.ts +++ b/tests/issues/GH1553.test.ts @@ -8,8 +8,7 @@ import { OneToMany, Collection, LoadStrategy, -} from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +} from '@mikro-orm/sqlite'; @Entity() export class Owner { @@ -79,11 +78,10 @@ export class Radio { describe('GH issue 1553', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Radio, RadioOption, Owner], loadStrategy: LoadStrategy.JOINED, diff --git a/tests/issues/GH1592.test.ts b/tests/issues/GH1592.test.ts index 3726a4f614e3..1d2d25ff67b2 100644 --- a/tests/issues/GH1592.test.ts +++ b/tests/issues/GH1592.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, IdentifiedReference, LoadStrategy, OneToOne } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, IdentifiedReference, LoadStrategy, OneToOne } from '@mikro-orm/sqlite'; @Entity() export class RadioOption { @@ -38,12 +37,11 @@ export class Radio { describe('GH issue 1592', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ dbName: `:memory:`, - driver: SqliteDriver, entities: [Radio, RadioOption], loadStrategy: LoadStrategy.JOINED, }); diff --git a/tests/issues/GH1595.test.ts b/tests/issues/GH1595.test.ts index db97b1a9ae78..0529f7842ff9 100644 --- a/tests/issues/GH1595.test.ts +++ b/tests/issues/GH1595.test.ts @@ -1,6 +1,5 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; @Entity() export class A { @@ -25,7 +24,6 @@ describe('GH issue 1595', () => { orm = await MikroORM.init({ entities: [A], dbName: 'mikro_orm_test_gh_1595', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH1616.test.ts b/tests/issues/GH1616.test.ts index 0f1872b62af1..eb68060143af 100644 --- a/tests/issues/GH1616.test.ts +++ b/tests/issues/GH1616.test.ts @@ -1,5 +1,4 @@ -import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Embeddable() export class D { @@ -45,7 +44,6 @@ describe('GH issue 1616', () => { const orm = await MikroORM.init({ entities: [C, D, A, B], dbName: ':memory:', - driver: SqliteDriver, }); const schema = await orm.schema.getCreateSchemaSQL({ wrap: false }); expect(schema).toMatchSnapshot(); diff --git a/tests/issues/GH1626.test.ts b/tests/issues/GH1626.test.ts index fb63bd573bd2..a70f0482a27c 100644 --- a/tests/issues/GH1626.test.ts +++ b/tests/issues/GH1626.test.ts @@ -1,12 +1,10 @@ import { BigIntType, Entity, - DefaultLogger, MikroORM, PrimaryKey, Property, -} from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +} from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; export class NativeBigIntType extends BigIntType { @@ -40,13 +38,12 @@ export class Author { } describe('GH issue 1626', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Author], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1657.test.ts b/tests/issues/GH1657.test.ts index 4aec25982233..af0e68dc19c3 100644 --- a/tests/issues/GH1657.test.ts +++ b/tests/issues/GH1657.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, wrap } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -49,13 +48,12 @@ class OrderItem { describe('GH issue 1657', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Order, OrderItem], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1664.test.ts b/tests/issues/GH1664.test.ts index 261c91b8595a..19fa3782d034 100644 --- a/tests/issues/GH1664.test.ts +++ b/tests/issues/GH1664.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; @Entity() @@ -22,13 +21,12 @@ class MultipleUniqueNullableProperties { } describe('embedded entities in postgresql', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [MultipleUniqueNullableProperties], dbName: 'mikro_orm_test_unique_nullable_insert', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH1704.test.ts b/tests/issues/GH1704.test.ts index c0bd48dd8955..fe70e421697e 100644 --- a/tests/issues/GH1704.test.ts +++ b/tests/issues/GH1704.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, OneToOne, MikroORM } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, PrimaryKey, Property, OneToOne, MikroORM } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -29,11 +28,10 @@ export class User { describe('GH issue 1704', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, entities: [User, Profile], dbName: ':memory:', }); diff --git a/tests/issues/GH1721.test.ts b/tests/issues/GH1721.test.ts index 8a88a5f661aa..b906136c6153 100644 --- a/tests/issues/GH1721.test.ts +++ b/tests/issues/GH1721.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/sqlite'; import { Guid } from 'guid-typescript'; import { mockLogger } from '../helpers'; @@ -43,13 +42,12 @@ export class Couch { describe('GH issue 1721', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Couch], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1831.test.ts b/tests/issues/GH1831.test.ts index 9edd4b313375..475b0896b7e4 100644 --- a/tests/issues/GH1831.test.ts +++ b/tests/issues/GH1831.test.ts @@ -8,8 +8,7 @@ import { PrimaryKey, Property, PlainObject, -} from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +} from '@mikro-orm/sqlite'; @Entity() export class FilterValue { @@ -80,11 +79,10 @@ export class ProjectDto extends PlainObject { describe('GH issue 1831', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Project, Filter, FilterValue], }); diff --git a/tests/issues/GH1882.test.ts b/tests/issues/GH1882.test.ts index c5a6940bc83d..8ac8e4d6652e 100644 --- a/tests/issues/GH1882.test.ts +++ b/tests/issues/GH1882.test.ts @@ -1,6 +1,5 @@ -import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PopulateHint, PrimaryKey, Property } from '@mikro-orm/core'; +import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PopulateHint, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class Foo { @@ -32,13 +31,12 @@ export class Bar { describe('GH issue 1882', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Foo, Bar], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1902.test.ts b/tests/issues/GH1902.test.ts index b52c3b706f9a..89dd58102ba7 100644 --- a/tests/issues/GH1902.test.ts +++ b/tests/issues/GH1902.test.ts @@ -1,5 +1,4 @@ -import { MikroORM, Entity, PrimaryKey, PrimaryKeyType, Unique, Collection, ManyToOne, OneToMany, Property, Filter, LoadStrategy, OptionalProps } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { MikroORM, Entity, PrimaryKey, PrimaryKeyType, Unique, Collection, ManyToOne, OneToMany, Property, Filter, LoadStrategy, OptionalProps } from '@mikro-orm/sqlite'; @Entity({ tableName: 'users' }) export class UserEntity { @@ -63,13 +62,12 @@ class UserTenantEntity { describe('GH issue 1902', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [UserEntity, TenantEntity, UserTenantEntity], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1910.test.ts b/tests/issues/GH1910.test.ts index 869b04d7cf8d..86a45825d9e4 100644 --- a/tests/issues/GH1910.test.ts +++ b/tests/issues/GH1910.test.ts @@ -1,6 +1,5 @@ -import type { EntityManager } from '@mikro-orm/core'; -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import type { EntityManager } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity() export class A { @@ -15,13 +14,12 @@ export class A { describe('GH issue 1910', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A], dbName: 'mikro_orm_test_gh_1910', - driver: PostgreSqlDriver, }); await orm.schema.ensureDatabase(); await orm.schema.dropSchema(); diff --git a/tests/issues/GH1927.test.ts b/tests/issues/GH1927.test.ts index 25228ef61711..dd5baeb0ccf7 100644 --- a/tests/issues/GH1927.test.ts +++ b/tests/issues/GH1927.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -40,13 +39,12 @@ export class Book { describe('GH issue 1927', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Author, Book], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1958.test.ts b/tests/issues/GH1958.test.ts index e481367e8f95..531f2bde0aa7 100644 --- a/tests/issues/GH1958.test.ts +++ b/tests/issues/GH1958.test.ts @@ -1,5 +1,4 @@ -import { Embeddable, Embedded, Entity, MikroORM, OneToOne, PrimaryKey, Property, Rel } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Embeddable, Embedded, Entity, MikroORM, OneToOne, PrimaryKey, Property, Rel } from '@mikro-orm/sqlite'; @Embeddable() class LoopOptions { @@ -56,7 +55,6 @@ describe('GH issue 1958', () => { orm = await MikroORM.init({ entities: [PlayerEntity, Options, LoopOptions], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH1968.test.ts b/tests/issues/GH1968.test.ts index b1de5a632ada..5eccb5ec442a 100644 --- a/tests/issues/GH1968.test.ts +++ b/tests/issues/GH1968.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() class Author { @@ -36,7 +35,6 @@ describe('GH issue 1968', () => { orm = await MikroORM.init({ entities: [Author, Book], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); diff --git a/tests/issues/GH1990.test.ts b/tests/issues/GH1990.test.ts index 673875eca3ce..1b100ed9f58d 100644 --- a/tests/issues/GH1990.test.ts +++ b/tests/issues/GH1990.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/postgresql'; @Entity() class A { @@ -31,7 +30,6 @@ describe('GH issue 1990', () => { orm = await MikroORM.init({ entities: [A, B], dbName: 'mikro_orm_test_1990', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH2059.test.ts b/tests/issues/GH2059.test.ts index 7dee8eece62b..faaa0d30f4fb 100644 --- a/tests/issues/GH2059.test.ts +++ b/tests/issues/GH2059.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/sqlite'; @Entity() class Category { @@ -25,13 +24,12 @@ class Category { describe('GH issue 2059', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Category], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2121.test.ts b/tests/issues/GH2121.test.ts index 4cd02287deb7..aae8c84c4511 100644 --- a/tests/issues/GH2121.test.ts +++ b/tests/issues/GH2121.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Tag { @@ -28,13 +27,12 @@ export class Product { describe('GH issue 2121', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Tag, Product], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2148.test.ts b/tests/issues/GH2148.test.ts index e4995ec84b07..554e3980f973 100644 --- a/tests/issues/GH2148.test.ts +++ b/tests/issues/GH2148.test.ts @@ -1,5 +1,4 @@ -import { Entity, IdentifiedReference, ManyToOne, MikroORM, PrimaryKey, Reference } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, IdentifiedReference, ManyToOne, MikroORM, PrimaryKey, Reference } from '@mikro-orm/postgresql'; @Entity() export class First { @@ -35,13 +34,12 @@ export class Third { describe('GH issue 2148', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [First, Second, Third], dbName: 'mikro_orm_test_2148', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH222.test.ts b/tests/issues/GH222.test.ts index 4f122d11904b..a4b2081ce426 100644 --- a/tests/issues/GH222.test.ts +++ b/tests/issues/GH222.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -48,15 +47,13 @@ export class B { describe('GH issue 222', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B, C], dbName: ':memory:', - driver: SqliteDriver, }); - await orm.schema.dropSchema(); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2233.test.ts b/tests/issues/GH2233.test.ts index 169a19aa4208..305332344249 100644 --- a/tests/issues/GH2233.test.ts +++ b/tests/issues/GH2233.test.ts @@ -1,5 +1,4 @@ -import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Embeddable() export class Lock { @@ -25,13 +24,12 @@ export class File { describe('GH issue 2233', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Lock, File], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2238.test.ts b/tests/issues/GH2238.test.ts index d86efa94cdd9..4e23a52440d4 100644 --- a/tests/issues/GH2238.test.ts +++ b/tests/issues/GH2238.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class First { @@ -28,13 +27,12 @@ export class Second { } describe('GH issue 2238', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [First, Second], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2273.test.ts b/tests/issues/GH2273.test.ts index 203264267464..ce6b352d3527 100644 --- a/tests/issues/GH2273.test.ts +++ b/tests/issues/GH2273.test.ts @@ -1,5 +1,4 @@ -import { Entity, LoadStrategy, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, LoadStrategy, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Checkout { @@ -72,7 +71,6 @@ describe('Remove entity issue (GH 2273)', () => { beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Discount, Checkout, Discount2, Checkout2], }); diff --git a/tests/issues/GH228.test.ts b/tests/issues/GH228.test.ts index 2fca3c632b48..849cd1e0711f 100644 --- a/tests/issues/GH228.test.ts +++ b/tests/issues/GH228.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -29,13 +28,12 @@ export class A { describe('GH issue 228', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH2293.test.ts b/tests/issues/GH2293.test.ts index f54907a1ff67..583e4a767c41 100644 --- a/tests/issues/GH2293.test.ts +++ b/tests/issues/GH2293.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, t } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, t } from '@mikro-orm/sqlite'; @Entity() export class TestEntity { @@ -14,13 +13,12 @@ export class TestEntity { describe('GH issue 2293', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [TestEntity], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.ensureDatabase(); await orm.schema.dropSchema(); diff --git a/tests/issues/GH234.test.ts b/tests/issues/GH234.test.ts index bfdd5eabd228..9582acd3ccba 100644 --- a/tests/issues/GH234.test.ts +++ b/tests/issues/GH234.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToMany, MikroORM, PopulateHint, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToMany, MikroORM, PopulateHint, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -32,13 +31,12 @@ export class B { describe('GH issue 234', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH2371.test.ts b/tests/issues/GH2371.test.ts index 00786af01d20..a6afdeb4e6da 100644 --- a/tests/issues/GH2371.test.ts +++ b/tests/issues/GH2371.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity({ tableName: 'vehicle', discriminatorColumn: 'type', abstract: true }) class Vehicle { @@ -37,13 +36,12 @@ class Garage { describe('GH issue 2371', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Car, Vehicle, Truck, Garage], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2379.test.ts b/tests/issues/GH2379.test.ts index 276bf5559010..3c12d0fafa63 100644 --- a/tests/issues/GH2379.test.ts +++ b/tests/issues/GH2379.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, OptionalProps, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { performance } from 'perf_hooks'; @Entity() @@ -106,13 +105,12 @@ export class Order { } describe('GH issue 2379', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Order, Job, VendorBuyerRelationship, Member], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2393.test.ts b/tests/issues/GH2393.test.ts index fb9eb7d609e7..a27d196f11f4 100644 --- a/tests/issues/GH2393.test.ts +++ b/tests/issues/GH2393.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -32,7 +31,6 @@ describe('GH issue 2393', () => { await expect(MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, connect: false, })).rejects.toThrowError('A.coll has unknown \'mappedBy\' reference: B.undefined'); }); diff --git a/tests/issues/GH2395.test.ts b/tests/issues/GH2395.test.ts index 7c7222a37315..d6803ce12cab 100644 --- a/tests/issues/GH2395.test.ts +++ b/tests/issues/GH2395.test.ts @@ -1,5 +1,4 @@ -import { Cascade, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Cascade, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Parent { @@ -53,13 +52,12 @@ export class Child3 { describe('GH issue 2395', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Parent, Child, Child2, Child3], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2406.test.ts b/tests/issues/GH2406.test.ts index d43decb98c94..0df3c0f725cc 100644 --- a/tests/issues/GH2406.test.ts +++ b/tests/issues/GH2406.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity({ forceConstructor: true }) export class Parent { @@ -25,13 +24,12 @@ export class Child { describe('GH issue 2406', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Parent, Child], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2410.test.ts b/tests/issues/GH2410.test.ts index a304c03d02be..3a28d4b04528 100644 --- a/tests/issues/GH2410.test.ts +++ b/tests/issues/GH2410.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Cascade, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Cascade, Collection, Entity, IdentifiedReference, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity({ tableName: 'user' }) class User { @@ -42,13 +41,12 @@ class MemberUser { describe('GH issue 2410', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, Member, MemberUser], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2489.test.ts b/tests/issues/GH2489.test.ts index cdeba04aa7ac..566640c309b8 100644 --- a/tests/issues/GH2489.test.ts +++ b/tests/issues/GH2489.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/postgresql'; export class IntegerArrayType extends Type { @@ -56,7 +55,6 @@ describe('GH issue 2489', () => { orm = await MikroORM.init({ entities: [Test], dbName: 'mikro_orm_test_2489', - driver: PostgreSqlDriver, cache: { enabled: true }, }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH2583.test.ts b/tests/issues/GH2583.test.ts index 06165bf34398..0f3fb05a1ed1 100644 --- a/tests/issues/GH2583.test.ts +++ b/tests/issues/GH2583.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Enum } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Enum } from '@mikro-orm/postgresql'; export enum WithEnumArrayValue { First = 'first', @@ -19,13 +18,12 @@ export class WithEnumArray { } describe('enum array with native PG enums (GH issue 2583)', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { - orm = await MikroORM.init({ + orm = await MikroORM.init({ entities: [WithEnumArray], dbName: 'mikro_orm_test_2583', - driver: PostgreSqlDriver, }); await orm.schema.dropDatabase('mikro_orm_test_2583'); await orm.schema.createDatabase('mikro_orm_test_2583'); diff --git a/tests/issues/GH2647.test.ts b/tests/issues/GH2647.test.ts index 82147d8778b1..5bbd058936e0 100644 --- a/tests/issues/GH2647.test.ts +++ b/tests/issues/GH2647.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Provider { @@ -84,7 +83,6 @@ describe('GH #2647, #2742', () => { orm = await MikroORM.init({ entities: [Provider, User, Member, Session, Participant], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2648.test.ts b/tests/issues/GH2648.test.ts index d3536d59447d..1dc1290ccfa7 100644 --- a/tests/issues/GH2648.test.ts +++ b/tests/issues/GH2648.test.ts @@ -1,5 +1,4 @@ -import { Entity, IdentifiedReference, JsonType, ManyToOne, MikroORM, OneToOne, PrimaryKey, PrimaryKeyType, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, IdentifiedReference, JsonType, ManyToOne, MikroORM, OneToOne, PrimaryKey, PrimaryKeyType, Property } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -89,13 +88,12 @@ export class D { describe('GH issue 2648', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B1, B2, B3, B4, C, D], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2663.test.ts b/tests/issues/GH2663.test.ts index 1e63ad9d59bb..5e6df572b9ed 100644 --- a/tests/issues/GH2663.test.ts +++ b/tests/issues/GH2663.test.ts @@ -1,5 +1,4 @@ -import { Embeddable, Embedded, Entity, LoadStrategy, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Embeddable, Embedded, Entity, LoadStrategy, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Embeddable() export class Z { @@ -33,13 +32,12 @@ export class B { describe('GH issue 2663', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B, Z], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2675.test.ts b/tests/issues/GH2675.test.ts index 0daf9885b340..84171c2fa3da 100644 --- a/tests/issues/GH2675.test.ts +++ b/tests/issues/GH2675.test.ts @@ -1,5 +1,4 @@ -import { Entity, LoadStrategy, ManyToOne, MikroORM, PrimaryKey, wrap } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, LoadStrategy, ManyToOne, MikroORM, PrimaryKey, wrap } from '@mikro-orm/postgresql'; @Entity() export class A { @@ -22,13 +21,12 @@ export class B { describe('GH issue 2675', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: 'mikro_orm_test_gh_2675', - driver: PostgreSqlDriver, }); await orm.schema.ensureDatabase(); diff --git a/tests/issues/GH2679.test.ts b/tests/issues/GH2679.test.ts index fa8ea31ae6cc..82452d71990e 100644 --- a/tests/issues/GH2679.test.ts +++ b/tests/issues/GH2679.test.ts @@ -1,5 +1,4 @@ -import { ArrayType, Entity, LoadStrategy, ManyToOne, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { ArrayType, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity() export class User { @@ -14,13 +13,12 @@ export class User { describe('GH issue 2679', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User], dbName: 'mikro_orm_test_gh_2679', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH268.test.ts b/tests/issues/GH268.test.ts index d54cf2a88ba9..cc403d23d1f0 100644 --- a/tests/issues/GH268.test.ts +++ b/tests/issues/GH268.test.ts @@ -1,6 +1,5 @@ import { v4 } from 'uuid'; -import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -32,13 +31,12 @@ export class B { describe('GH issue 268', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH269.test.ts b/tests/issues/GH269.test.ts index 99abba0e7abe..435d8e9e2992 100644 --- a/tests/issues/GH269.test.ts +++ b/tests/issues/GH269.test.ts @@ -1,5 +1,4 @@ -import { Entity, IdentifiedReference, MikroORM, OneToOne, PrimaryKey, Property, wrap, Reference } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, IdentifiedReference, MikroORM, OneToOne, PrimaryKey, Property, wrap, Reference } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -31,13 +30,12 @@ export class B { describe('GH issue 269', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, autoJoinOneToOneOwner: false, }); await orm.schema.dropSchema(); diff --git a/tests/issues/GH2703.test.ts b/tests/issues/GH2703.test.ts index 63de522a6b49..152beb81a798 100644 --- a/tests/issues/GH2703.test.ts +++ b/tests/issues/GH2703.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -24,13 +23,12 @@ export class Order { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, Order], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2729.test.ts b/tests/issues/GH2729.test.ts index ccd8d510d28b..87516265ddec 100644 --- a/tests/issues/GH2729.test.ts +++ b/tests/issues/GH2729.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property, MikroORM } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property, MikroORM } from '@mikro-orm/sqlite'; @Entity({ tableName: 'person', @@ -39,7 +38,6 @@ describe('GH #2729', () => { beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [PersonEntity, TaskEntity], }); diff --git a/tests/issues/GH2760.test.ts b/tests/issues/GH2760.test.ts index 50e30cd4610c..5ff7b7fa082e 100644 --- a/tests/issues/GH2760.test.ts +++ b/tests/issues/GH2760.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class User { @@ -30,7 +29,6 @@ describe('GH issue 2760', () => { orm = await MikroORM.init({ entities: [User], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2774.test.ts b/tests/issues/GH2774.test.ts index 411778021706..910889a9994a 100644 --- a/tests/issues/GH2774.test.ts +++ b/tests/issues/GH2774.test.ts @@ -1,5 +1,4 @@ -import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Embeddable() export class Nested { @@ -39,7 +38,6 @@ describe('GH issue 2774', () => { orm = await MikroORM.init({ entities: [User, Name, Nested], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2777.test.ts b/tests/issues/GH2777.test.ts index de0bba54db2e..9e3bccdc3d2a 100644 --- a/tests/issues/GH2777.test.ts +++ b/tests/issues/GH2777.test.ts @@ -1,5 +1,4 @@ -import { Entity, LoadStrategy, ManyToOne, MikroORM, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, LoadStrategy, ManyToOne, MikroORM, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/sqlite'; @Entity() export class Image { @@ -72,7 +71,6 @@ describe('GH issue 2777', () => { orm = await MikroORM.init({ entities: [Customer, Comment, Product, Image], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2781.test.ts b/tests/issues/GH2781.test.ts index 17c741f0b9aa..2d588c75b0b6 100644 --- a/tests/issues/GH2781.test.ts +++ b/tests/issues/GH2781.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity() export class Address { @@ -54,7 +53,6 @@ describe('GH issue 2781', () => { beforeAll(async () => { orm = await MikroORM.init({ entities: [Address, Customer], - driver: PostgreSqlDriver, dbName: 'mikro_orm_test_2781', }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH2784.test.ts b/tests/issues/GH2784.test.ts index 333847eaa668..0a5e2e95d441 100644 --- a/tests/issues/GH2784.test.ts +++ b/tests/issues/GH2784.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity() export class Address { @@ -39,7 +38,6 @@ describe('GH issue 2784', () => { beforeAll(async () => { orm = await MikroORM.init({ entities: [Address], - driver: PostgreSqlDriver, dbName: 'mikro_orm_test_2781', }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH2803.test.ts b/tests/issues/GH2803.test.ts index 4708c4ef926e..ed6b13ee43cf 100644 --- a/tests/issues/GH2803.test.ts +++ b/tests/issues/GH2803.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, LoadStrategy, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -33,11 +32,10 @@ export class Tag { describe('GH issue 2803', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Book, Tag], }); diff --git a/tests/issues/GH2806.test.ts b/tests/issues/GH2806.test.ts index 02c7979a54d8..0da1131b7699 100644 --- a/tests/issues/GH2806.test.ts +++ b/tests/issues/GH2806.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -37,7 +36,6 @@ describe('GH issue 2806', () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH2810.test.ts b/tests/issues/GH2810.test.ts index 90ce3f5b5f11..058bcc548bb1 100644 --- a/tests/issues/GH2810.test.ts +++ b/tests/issues/GH2810.test.ts @@ -1,5 +1,4 @@ -import { Cascade, Collection, Entity, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Cascade, Collection, Entity, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, PrimaryKeyProp, PrimaryKeyType } from '@mikro-orm/sqlite'; @Entity() export class NodeEntity { @@ -45,7 +44,6 @@ describe('GH issue 2810', () => { orm = await MikroORM.init({ entities: [ElementEntity, DependentEntity, NodeEntity], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2815.test.ts b/tests/issues/GH2815.test.ts index 06ddce0b80f8..a4fd3620508c 100644 --- a/tests/issues/GH2815.test.ts +++ b/tests/issues/GH2815.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Position { @@ -47,11 +46,10 @@ export class Leg2 { describe('GH issue 2815', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Position, Leg, Position2, Leg2], }); diff --git a/tests/issues/GH2821.test.ts b/tests/issues/GH2821.test.ts index 7774bb152a5a..8f5422dc0282 100644 --- a/tests/issues/GH2821.test.ts +++ b/tests/issues/GH2821.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Position { @@ -31,11 +30,10 @@ export class Leg { describe('GH issue 2821', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Position, Leg], }); diff --git a/tests/issues/GH2829.test.ts b/tests/issues/GH2829.test.ts index 7c57f846f50e..c0ed824d97ea 100644 --- a/tests/issues/GH2829.test.ts +++ b/tests/issues/GH2829.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Author { @@ -37,13 +36,12 @@ export class Book { describe('GH issue 2829', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Author, Book], dbName: ':memory:', - driver: SqliteDriver, connect: false, }); }); diff --git a/tests/issues/GH2882.test.ts b/tests/issues/GH2882.test.ts index 3b97e87aa2cf..f6c59a153b06 100644 --- a/tests/issues/GH2882.test.ts +++ b/tests/issues/GH2882.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, wrap } from '@mikro-orm/sqlite'; @Entity() export class Parent { @@ -25,11 +24,10 @@ export default class Child { describe('GH issue 2882', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Parent, Child], }); diff --git a/tests/issues/GH2886.test.ts b/tests/issues/GH2886.test.ts index 4c97d66522d2..f5a323f9b2bb 100644 --- a/tests/issues/GH2886.test.ts +++ b/tests/issues/GH2886.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, OneToMany, Collection, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, OneToMany, Collection, MikroORM, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Provider { @@ -84,7 +83,6 @@ describe('GH #2886', () => { orm = await MikroORM.init({ entities: [Provider, User, Member, Session, Participant], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2973.test.ts b/tests/issues/GH2973.test.ts index 2d7895772cf8..79eea2b363c5 100644 --- a/tests/issues/GH2973.test.ts +++ b/tests/issues/GH2973.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/better-sqlite'; @Entity() class Author { @@ -18,7 +17,6 @@ beforeAll(async () => { orm = await MikroORM.init({ entities: [Author], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2974.test.ts b/tests/issues/GH2974.test.ts index 1e30cb200e19..820f82ef3111 100644 --- a/tests/issues/GH2974.test.ts +++ b/tests/issues/GH2974.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/better-sqlite'; @Entity() export class SomeMany { @@ -35,7 +34,6 @@ beforeAll(async () => { orm = await MikroORM.init({ entities: [Test, SomeMany], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH2990.test.ts b/tests/issues/GH2990.test.ts index 776cb7908fe7..68fb610af76c 100644 --- a/tests/issues/GH2990.test.ts +++ b/tests/issues/GH2990.test.ts @@ -1,5 +1,4 @@ -import { Entity, EntityLoader, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Entity, EntityLoader, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/better-sqlite'; @Entity() export class Provider { @@ -68,7 +67,6 @@ describe('GH issue 2990', () => { orm = await MikroORM.init({ entities: [Provider, User, Member, Session], dbName: `:memory:`, - driver: BetterSqliteDriver, }); }); diff --git a/tests/issues/GH3005.test.ts b/tests/issues/GH3005.test.ts index 26892a78c350..503fb79b9683 100644 --- a/tests/issues/GH3005.test.ts +++ b/tests/issues/GH3005.test.ts @@ -1,6 +1,5 @@ -import type { EventSubscriber, FlushEventArgs } from '@mikro-orm/core'; -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, Subscriber, wrap } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import type { EventSubscriber, FlushEventArgs } from '@mikro-orm/better-sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, Subscriber, wrap } from '@mikro-orm/better-sqlite'; @Entity({ tableName: 'customers' }) class Customer { @@ -49,13 +48,12 @@ class OrdersSubscriber implements EventSubscriber { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Order, Customer], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH302.test.ts b/tests/issues/GH302.test.ts index 3eabee4cc1c9..af857fa92817 100644 --- a/tests/issues/GH302.test.ts +++ b/tests/issues/GH302.test.ts @@ -1,5 +1,4 @@ -import { Entity, Ref, MikroORM, PrimaryKey, Property, Reference, ManyToOne, OneToMany, Collection } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, Ref, MikroORM, PrimaryKey, Property, Reference, ManyToOne, OneToMany, Collection } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -36,13 +35,12 @@ export class B { describe('GH issue 302', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH3026.test.ts b/tests/issues/GH3026.test.ts index 2c6453e22fb4..4958adeb5e41 100644 --- a/tests/issues/GH3026.test.ts +++ b/tests/issues/GH3026.test.ts @@ -1,6 +1,5 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/core'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, wrap } from '@mikro-orm/better-sqlite'; import { mockLogger } from '../helpers'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; @Entity() export class Ingredient { @@ -53,7 +52,6 @@ beforeAll(async () => { orm = await MikroORM.init({ entities: [Ingredient, Recipe, RecipeIngredient], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3053.test.ts b/tests/issues/GH3053.test.ts index a572c925cee1..2382bbc560b5 100644 --- a/tests/issues/GH3053.test.ts +++ b/tests/issues/GH3053.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, Enum, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, Enum, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() class Book { @@ -30,13 +29,12 @@ class Author { book!: Book; } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Author, Book], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3054.test.ts b/tests/issues/GH3054.test.ts index d204b80ccd01..a0a1c54709a5 100644 --- a/tests/issues/GH3054.test.ts +++ b/tests/issues/GH3054.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() class User { @@ -12,13 +11,12 @@ class User { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3221.test.ts b/tests/issues/GH3221.test.ts index 2b467e68e239..28725833a6c5 100644 --- a/tests/issues/GH3221.test.ts +++ b/tests/issues/GH3221.test.ts @@ -1,6 +1,5 @@ import 'reflect-metadata'; -import { Entity, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; interface BookData { title: string; @@ -20,7 +19,6 @@ class Book { test(`GH issue 3221`, async () => { const orm = await MikroORM.init({ entities: [Book], - driver: SqliteDriver, dbName: ':memory:', }); diff --git a/tests/issues/GH3240.test.ts b/tests/issues/GH3240.test.ts index 8e3899a6416a..fe81cdc18861 100644 --- a/tests/issues/GH3240.test.ts +++ b/tests/issues/GH3240.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToMany, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite'; type SquadType = 'GROUND' | 'AIR'; @@ -40,13 +39,12 @@ export class Squad { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Soldier, Squad], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3269.test.ts b/tests/issues/GH3269.test.ts index f9566017b64d..755d7d837c67 100644 --- a/tests/issues/GH3269.test.ts +++ b/tests/issues/GH3269.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, ManyToOne, PrimaryKeyType } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, ManyToOne, PrimaryKeyType } from '@mikro-orm/better-sqlite'; @Entity() class Main { @@ -51,7 +50,6 @@ let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: BetterSqliteDriver, dbName: ':memory:', entities: [LogEntry], }); diff --git a/tests/issues/GH3271.test.ts b/tests/issues/GH3271.test.ts index 47e66f27b056..ce35ab4c7c62 100644 --- a/tests/issues/GH3271.test.ts +++ b/tests/issues/GH3271.test.ts @@ -1,5 +1,4 @@ -import type { MikroORM } from '@mikro-orm/core'; -import { wrap } from '@mikro-orm/core'; +import { MikroORM, wrap } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; import { initORMPostgreSql } from '../bootstrap'; import { Author2, Book2 } from '../entities-sql'; diff --git a/tests/issues/GH3287.test.ts b/tests/issues/GH3287.test.ts index ac228fd6c5e9..4d6265622a7b 100644 --- a/tests/issues/GH3287.test.ts +++ b/tests/issues/GH3287.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, LoadStrategy, ManyToMany, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Collection, Entity, LoadStrategy, ManyToMany, MikroORM, PrimaryKey } from '@mikro-orm/better-sqlite'; @Entity() export class Group { @@ -35,7 +34,6 @@ beforeAll(async () => { orm = await MikroORM.init({ entities: [Participant], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3292.test.ts b/tests/issues/GH3292.test.ts index 09e364927d53..64cf872b76b5 100644 --- a/tests/issues/GH3292.test.ts +++ b/tests/issues/GH3292.test.ts @@ -1,4 +1,4 @@ -import type { MikroORM } from '@mikro-orm/core'; +import type { MikroORM } from '@mikro-orm/postgresql'; import { initORMPostgreSql } from '../bootstrap'; import { Author2, Book2 } from '../entities-sql'; diff --git a/tests/issues/GH3301.test.ts b/tests/issues/GH3301.test.ts index 37b54fe34446..29f012d1028f 100644 --- a/tests/issues/GH3301.test.ts +++ b/tests/issues/GH3301.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, OneToMany, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +import { Collection, Entity, OneToMany, ManyToOne, MikroORM, PrimaryKey } from '@mikro-orm/better-sqlite'; @Entity() export class Collector { @@ -43,17 +42,12 @@ export class Collect { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - entities: [ - Collect, - Collector, - Collectable, - ], + entities: [Collect, Collector, Collectable], dbName: ':memory:', - driver: BetterSqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3339.test.ts b/tests/issues/GH3339.test.ts index 342ded1c7222..6e6de6ad25dd 100644 --- a/tests/issues/GH3339.test.ts +++ b/tests/issues/GH3339.test.ts @@ -1,6 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql'; @Entity({ @@ -49,7 +47,6 @@ describe('GH issue 3339', () => { beforeAll(async () => { orm = await MikroORM.init({ dbName: `mikro_orm_test_gh_3339`, - driver: PostgreSqlDriver, schema: 'gh3339', entities: [ Customer1 ], }); diff --git a/tests/issues/GH3345.test.ts b/tests/issues/GH3345.test.ts index d3a502de4c2a..34e5d53bc678 100644 --- a/tests/issues/GH3345.test.ts +++ b/tests/issues/GH3345.test.ts @@ -1,6 +1,5 @@ -import type { EventSubscriber, FlushEventArgs } from '@mikro-orm/core'; -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, Subscriber } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import type { EventSubscriber, FlushEventArgs } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property, Subscriber } from '@mikro-orm/sqlite'; @Entity({ tableName: 'customers' }) class Customer { @@ -49,13 +48,12 @@ class OrdersSubscriber implements EventSubscriber { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Customer], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3354.test.ts b/tests/issues/GH3354.test.ts index 1ce689ea81e3..b3f7f9efaa06 100644 --- a/tests/issues/GH3354.test.ts +++ b/tests/issues/GH3354.test.ts @@ -1,5 +1,4 @@ -import { BaseEntity, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BaseEntity, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Group extends BaseEntity { @@ -18,13 +17,12 @@ export class Group extends BaseEntity { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Group], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3360.test.ts b/tests/issues/GH3360.test.ts index 3c2d5d74d614..3a949c418981 100644 --- a/tests/issues/GH3360.test.ts +++ b/tests/issues/GH3360.test.ts @@ -1,6 +1,5 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/better-sqlite'; import { mockLogger } from '../helpers'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; @Entity() export class Author { @@ -50,11 +49,10 @@ async function createEntities(orm: MikroORM) { orm.em.clear(); } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: BetterSqliteDriver, dbName: ':memory:', entities: [Book], }); diff --git a/tests/issues/GH3429.test.ts b/tests/issues/GH3429.test.ts index daafa6db5ce6..f80186e3537c 100644 --- a/tests/issues/GH3429.test.ts +++ b/tests/issues/GH3429.test.ts @@ -1,5 +1,4 @@ -import { SqliteDriver } from '@mikro-orm/sqlite'; -import { MikroORM, Embeddable, Embedded, Entity, PrimaryKey, Property } from '@mikro-orm/core'; +import { MikroORM, Embeddable, Embedded, Entity, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Embeddable() class Address { @@ -34,11 +33,10 @@ export class Organization { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ - driver: SqliteDriver, dbName: ':memory:', entities: [Organization], }); diff --git a/tests/issues/GH349.test.ts b/tests/issues/GH349.test.ts index b624ca91fdd5..23c3f4433dc9 100644 --- a/tests/issues/GH349.test.ts +++ b/tests/issues/GH349.test.ts @@ -1,6 +1,5 @@ -import { Entity, PrimaryKey, Property, SerializedPrimaryKey } from '@mikro-orm/core'; +import { Entity, MikroORM, PrimaryKey, Property, SerializedPrimaryKey } from '@mikro-orm/mongodb'; import { Decimal128, ObjectId } from 'bson'; -import { MikroORM } from '@mikro-orm/mongodb'; @Entity() class A { diff --git a/tests/issues/GH3490.test.ts b/tests/issues/GH3490.test.ts index 8590248ee049..226eca73a2a3 100644 --- a/tests/issues/GH3490.test.ts +++ b/tests/issues/GH3490.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey } from '@mikro-orm/sqlite'; @Entity() export class Contract { @@ -29,13 +28,12 @@ export class Customer { } -let orm: MikroORM; +let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Contract, Customer], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3540.test.ts b/tests/issues/GH3540.test.ts index fdb43d48dd27..a9b5305d3966 100644 --- a/tests/issues/GH3540.test.ts +++ b/tests/issues/GH3540.test.ts @@ -1,5 +1,4 @@ -import { ArrayType, Entity, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/mysql'; +import { MikroORM, ArrayType, Entity, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/mysql'; import { mockLogger } from '../helpers'; @Entity() diff --git a/tests/issues/GH3543.test.ts b/tests/issues/GH3543.test.ts index cf727ff3926d..ad7ed9b36120 100644 --- a/tests/issues/GH3543.test.ts +++ b/tests/issues/GH3543.test.ts @@ -7,8 +7,8 @@ import { OptionalProps, PrimaryKey, Property, -} from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/postgresql'; + MikroORM, +} from '@mikro-orm/postgresql'; import { v4 } from 'uuid'; @Entity() diff --git a/tests/issues/GH3548.test.ts b/tests/issues/GH3548.test.ts index 0a6834161933..e613d335a9c5 100644 --- a/tests/issues/GH3548.test.ts +++ b/tests/issues/GH3548.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, OneToOne } from '@mikro-orm/core'; -import { MikroORM, ObjectId } from '@mikro-orm/mongodb'; +import { MikroORM, ObjectId, Entity, PrimaryKey, Property, OneToOne } from '@mikro-orm/mongodb'; @Entity() export class Author { diff --git a/tests/issues/GH3564.test.ts b/tests/issues/GH3564.test.ts index be2b4f36c445..eeb88e543c0e 100644 --- a/tests/issues/GH3564.test.ts +++ b/tests/issues/GH3564.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, IdentifiedReference, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { MikroORM, SqliteDriver } from '@mikro-orm/sqlite'; +import { MikroORM, Collection, Entity, IdentifiedReference, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() class Part { @@ -54,7 +53,6 @@ beforeAll(async () => { orm = await MikroORM.init({ entities: [Car, Part], dbName: ':memory:', - driver: SqliteDriver, }); await orm.getSchemaGenerator().createSchema(); }); diff --git a/tests/issues/GH3576.test.ts b/tests/issues/GH3576.test.ts index 7f14842b81c5..48719eec660e 100644 --- a/tests/issues/GH3576.test.ts +++ b/tests/issues/GH3576.test.ts @@ -1,6 +1,5 @@ -import { Entity, LoadStrategy, OneToOne, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/core'; +import { MikroORM, Entity, LoadStrategy, OneToOne, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { MikroORM } from '@mikro-orm/sqlite'; @Entity() class User { diff --git a/tests/issues/GH3603.test.ts b/tests/issues/GH3603.test.ts index 05863c4fe939..69cdd0e39d5b 100644 --- a/tests/issues/GH3603.test.ts +++ b/tests/issues/GH3603.test.ts @@ -1,5 +1,4 @@ -import { EntitySchema } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +import { MikroORM, EntitySchema } from '@mikro-orm/sqlite'; interface MyEntity { _id: number; diff --git a/tests/issues/GH3614.test.ts b/tests/issues/GH3614.test.ts index 0a40691af1f6..5e90a127a6f3 100644 --- a/tests/issues/GH3614.test.ts +++ b/tests/issues/GH3614.test.ts @@ -1,5 +1,4 @@ -import { Entity, Ref, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, Ref, OneToOne, PrimaryKey, Property, wrap } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() diff --git a/tests/issues/GH3666.test.ts b/tests/issues/GH3666.test.ts index e134008039bb..65c1a46209ab 100644 --- a/tests/issues/GH3666.test.ts +++ b/tests/issues/GH3666.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, ManyToOne, Collection, OneToMany } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +import { MikroORM, Entity, PrimaryKey, ManyToOne, Collection, OneToMany } from '@mikro-orm/sqlite'; @Entity() class Competition { diff --git a/tests/issues/GH3669.test.ts b/tests/issues/GH3669.test.ts index 2d51be9437f9..4f0ec103ddec 100644 --- a/tests/issues/GH3669.test.ts +++ b/tests/issues/GH3669.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, OneToOne, PrimaryKey, PrimaryKeyType, Property, Rel, SimpleLogger } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, ManyToOne, OneToOne, PrimaryKey, PrimaryKeyType, Property, Rel, SimpleLogger } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; @Entity() diff --git a/tests/issues/GH369.test.ts b/tests/issues/GH369.test.ts index b64bcfd9f8c4..e7bdea330fd3 100644 --- a/tests/issues/GH369.test.ts +++ b/tests/issues/GH369.test.ts @@ -1,5 +1,4 @@ -import { Entity, ManyToOne, OneToMany, PrimaryKey, Property, Collection, MikroORM } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, ManyToOne, OneToMany, PrimaryKey, Property, Collection, MikroORM } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -29,13 +28,12 @@ class B { describe('GH issue 369', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH3694.test.ts b/tests/issues/GH3694.test.ts index b790b6252887..062b0686a93a 100644 --- a/tests/issues/GH3694.test.ts +++ b/tests/issues/GH3694.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Ref, OneToMany, Collection, ManyToOne, Enum, wrap, compareArrays } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +import { Entity, PrimaryKey, Ref, OneToMany, Collection, ManyToOne, Enum, wrap, MikroORM } from '@mikro-orm/sqlite'; enum Enum1 { A = 'A', diff --git a/tests/issues/GH3696.test.ts b/tests/issues/GH3696.test.ts index 40784470c2ef..016492aae679 100644 --- a/tests/issues/GH3696.test.ts +++ b/tests/issues/GH3696.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, Index, ManyToMany, PrimaryKey, Property, Unique } from '@mikro-orm/core'; -import { FullTextType, MikroORM } from '@mikro-orm/postgresql'; +import { FullTextType, MikroORM, Collection, Entity, Index, ManyToMany, PrimaryKey, Property, Unique } from '@mikro-orm/postgresql'; @Entity() @Unique({ properties: ['name'] }) diff --git a/tests/issues/GH3737.test.ts b/tests/issues/GH3737.test.ts index 6db4a886a999..7e049d4cd8b9 100644 --- a/tests/issues/GH3737.test.ts +++ b/tests/issues/GH3737.test.ts @@ -9,8 +9,7 @@ import { OneToMany, PrimaryKey, Property, -} from '@mikro-orm/core'; -import { BetterSqliteDriver } from '@mikro-orm/better-sqlite'; +} from '@mikro-orm/better-sqlite'; @Entity() class Project { @@ -94,7 +93,6 @@ let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Project, User], - driver: BetterSqliteDriver, dbName: ':memory:', subscribers: [new ProjectUsersSubscriber()], }); diff --git a/tests/issues/GH3738.test.ts b/tests/issues/GH3738.test.ts index 1595c4efcc0e..420330c35101 100644 --- a/tests/issues/GH3738.test.ts +++ b/tests/issues/GH3738.test.ts @@ -2,12 +2,13 @@ import { Collection, Entity, LoadStrategy, + MikroORM, ManyToOne, - OneToMany, OptionalProps, + OneToMany, + OptionalProps, PrimaryKey, Property, -} from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/sqlite'; +} from '@mikro-orm/sqlite'; import { randomUUID } from 'crypto'; @Entity() diff --git a/tests/issues/GH3739.test.ts b/tests/issues/GH3739.test.ts index be3aabdfb31f..be6bc467994f 100644 --- a/tests/issues/GH3739.test.ts +++ b/tests/issues/GH3739.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, t } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/mysql'; +import { Entity, MikroORM, PrimaryKey, Property, t } from '@mikro-orm/mysql'; @Entity() export class Asset1 { diff --git a/tests/issues/GH380.test.ts b/tests/issues/GH380.test.ts index c2edeefb1aa4..5240af3fa2eb 100644 --- a/tests/issues/GH380.test.ts +++ b/tests/issues/GH380.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, Property, MikroORM } from '@mikro-orm/postgresql'; @Entity() class A { @@ -17,13 +16,12 @@ class A { describe('GH issue 380', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A], dbName: `mikro_orm_test_gh_380`, - driver: PostgreSqlDriver, }); await orm.schema.ensureDatabase(); await orm.schema.dropSchema(); diff --git a/tests/issues/GH3810.test.ts b/tests/issues/GH3810.test.ts index c81fe08f6d9c..ae0d02d2c3ce 100644 --- a/tests/issues/GH3810.test.ts +++ b/tests/issues/GH3810.test.ts @@ -1,5 +1,4 @@ -import { Entity, OptionalProps, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/postgresql'; +import { MikroORM, Entity, OptionalProps, PrimaryKey, Property, SimpleLogger } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; @Entity() diff --git a/tests/issues/GH435.test.ts b/tests/issues/GH435.test.ts index fc7d53e91836..34189fe3dc4d 100644 --- a/tests/issues/GH435.test.ts +++ b/tests/issues/GH435.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, Property, Type } from '@mikro-orm/sqlite'; class MyType extends Type { @@ -30,13 +29,12 @@ class A { describe('GH issue 435', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.ensureDatabase(); await orm.schema.dropSchema(); diff --git a/tests/issues/GH450.test.ts b/tests/issues/GH450.test.ts index 21c7f15595f5..9476e2de567b 100644 --- a/tests/issues/GH450.test.ts +++ b/tests/issues/GH450.test.ts @@ -1,6 +1,5 @@ import 'reflect-metadata'; -import { Collection, Entity, ManyToMany, ManyToOne, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Collection, Entity, ManyToMany, ManyToOne, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/postgresql'; @Entity({ tableName: 'auth.users' }) class TaskAssignee { @@ -41,13 +40,12 @@ class Task { describe('GH issue 450', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Task, TaskAssignee], dbName: `mikro_orm_test_gh_450`, - driver: PostgreSqlDriver, cache: { enabled: false }, }); await orm.schema.ensureDatabase(); diff --git a/tests/issues/GH459.test.ts b/tests/issues/GH459.test.ts index b6ddc28121b6..3648703c6357 100644 --- a/tests/issues/GH459.test.ts +++ b/tests/issues/GH459.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, PrimaryKey, Property, MikroORM } from '@mikro-orm/sqlite'; abstract class A { @@ -32,13 +31,12 @@ class D extends C { describe('GH issue 459', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B, C, D], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH463.test.ts b/tests/issues/GH463.test.ts index 31f0891131d8..b610ec8f7cf6 100644 --- a/tests/issues/GH463.test.ts +++ b/tests/issues/GH463.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM, Index, Unique } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, PrimaryKey, Property, MikroORM, Index, Unique } from '@mikro-orm/sqlite'; abstract class A { @@ -26,13 +25,12 @@ class B extends A { describe('GH issue 463', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH467.test.ts b/tests/issues/GH467.test.ts index 085d491e1a14..3b4fca11447c 100644 --- a/tests/issues/GH467.test.ts +++ b/tests/issues/GH467.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, PrimaryKey, ManyToOne, OneToMany, MikroORM, IdentifiedReference } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, PrimaryKey, ManyToOne, OneToMany, MikroORM, IdentifiedReference } from '@mikro-orm/sqlite'; @Entity() class A { @@ -25,13 +24,12 @@ class B { describe('GH issue 467', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH472.test.ts b/tests/issues/GH472.test.ts index b2f562b13bb3..2039cb334f5b 100644 --- a/tests/issues/GH472.test.ts +++ b/tests/issues/GH472.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM, EntityCaseNamingStrategy } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, Property, MikroORM, EntityCaseNamingStrategy } from '@mikro-orm/postgresql'; @Entity() class A { @@ -14,13 +13,12 @@ class A { describe('GH issue 472', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A], dbName: 'mikro_orm_test_gh472', - driver: PostgreSqlDriver, namingStrategy: EntityCaseNamingStrategy, }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH482.test.ts b/tests/issues/GH482.test.ts index ece877e3c11c..9b67c02cad4d 100644 --- a/tests/issues/GH482.test.ts +++ b/tests/issues/GH482.test.ts @@ -1,6 +1,5 @@ -import { Entity, PrimaryKey, BigIntType, OneToMany, Collection, Enum, ManyToOne, Property } from '@mikro-orm/core'; +import { Entity, MikroORM, PrimaryKey, BigIntType, OneToMany, Collection, Enum, ManyToOne, Property } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; -import { MikroORM } from '@mikro-orm/postgresql'; export enum LevelType { A = 'a', diff --git a/tests/issues/GH486.test.ts b/tests/issues/GH486.test.ts index 2ef6c2744b4d..2e6c1467a128 100644 --- a/tests/issues/GH486.test.ts +++ b/tests/issues/GH486.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, OneToMany, MikroORM, Collection, ManyToOne } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, Property, OneToMany, MikroORM, Collection, ManyToOne } from '@mikro-orm/postgresql'; @Entity() class A { @@ -28,13 +27,12 @@ class B { describe('GH issue 486', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: `mikro_orm_test_gh_486`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH493.test.ts b/tests/issues/GH493.test.ts index e5989506743b..bd639d46c376 100644 --- a/tests/issues/GH493.test.ts +++ b/tests/issues/GH493.test.ts @@ -1,5 +1,4 @@ -import { BeforeDelete, BeforeUpdate, Entity, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BeforeDelete, BeforeUpdate, Entity, MikroORM, PrimaryKey, Property, wrap } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -24,13 +23,12 @@ export class A { describe('GH issue 493', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH519.test.ts b/tests/issues/GH519.test.ts index b4462b6ce45a..93810e09e6c9 100644 --- a/tests/issues/GH519.test.ts +++ b/tests/issues/GH519.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, MikroORM, ManyToOne, Collection, OneToMany } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, MikroORM, ManyToOne, Collection, OneToMany } from '@mikro-orm/postgresql'; import { mockLogger } from '../helpers'; @Entity() @@ -42,13 +41,12 @@ class Registration { describe('GH issue 519', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Competition, User, Registration], dbName: `mikro_orm_test_gh_519`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH529.test.ts b/tests/issues/GH529.test.ts index ebdc01ef450d..7256727b60b8 100644 --- a/tests/issues/GH529.test.ts +++ b/tests/issues/GH529.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Property } from '@mikro-orm/postgresql'; @Entity() export class Customer { @@ -83,13 +82,12 @@ export class OrderItem { describe('GH issue 529', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Customer, Order, OrderItem, Product], dbName: `mikro_orm_test_gh_529`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH533.test.ts b/tests/issues/GH533.test.ts index 074f2cd72954..d762261977f7 100644 --- a/tests/issues/GH533.test.ts +++ b/tests/issues/GH533.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM, wrap, ManyToOne } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, Property, MikroORM, wrap, ManyToOne } from '@mikro-orm/postgresql'; @Entity() class A { @@ -44,13 +43,12 @@ class C { describe('GH issue 533', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B, C], dbName: `mikro_orm_test_gh_533`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH535.test.ts b/tests/issues/GH535.test.ts index c8dc09fb502d..0c940dcce099 100644 --- a/tests/issues/GH535.test.ts +++ b/tests/issues/GH535.test.ts @@ -1,5 +1,4 @@ -import { Entity, PrimaryKey, Property, MikroORM, wrap, IdentifiedReference, OneToOne } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, PrimaryKey, Property, MikroORM, wrap, IdentifiedReference, OneToOne } from '@mikro-orm/postgresql'; @Entity() class A { @@ -38,13 +37,12 @@ class B { describe('GH issue 535', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: `mikro_orm_test_gh_535`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH557.test.ts b/tests/issues/GH557.test.ts index 932a6ea6d866..7c0ce23ebc89 100644 --- a/tests/issues/GH557.test.ts +++ b/tests/issues/GH557.test.ts @@ -1,5 +1,4 @@ -import { MikroORM, Entity, ManyToOne, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { MikroORM, Entity, ManyToOne, OneToOne, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() export class Rate { @@ -44,13 +43,12 @@ export class Application { describe('GH issue 557', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Application, Rate], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH560.test.ts b/tests/issues/GH560.test.ts index 57713341ce3c..08b74da1cd55 100644 --- a/tests/issues/GH560.test.ts +++ b/tests/issues/GH560.test.ts @@ -1,5 +1,4 @@ -import { EntitySchema, MikroORM } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { EntitySchema, MikroORM } from '@mikro-orm/postgresql'; import { v4 } from 'uuid'; class Base { @@ -46,13 +45,12 @@ const ASchema = new EntitySchema({ describe('GH issue 560', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [ASchema, BaseSchema], dbName: `mikro_orm_test_gh_560`, - driver: PostgreSqlDriver, cache: { enabled: false }, }); await orm.schema.refreshDatabase(); diff --git a/tests/issues/GH572.test.ts b/tests/issues/GH572.test.ts index 1a573bc4097c..d7f6052f3b8b 100644 --- a/tests/issues/GH572.test.ts +++ b/tests/issues/GH572.test.ts @@ -1,6 +1,5 @@ -import { Entity, IdentifiedReference, MikroORM, OneToOne, PrimaryKey, Property, QueryOrder } from '@mikro-orm/core'; +import { Entity, IdentifiedReference, MikroORM, OneToOne, PrimaryKey, Property, QueryOrder } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -29,13 +28,12 @@ export class B { describe('GH issue 572', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH589.test.ts b/tests/issues/GH589.test.ts index 881ff30c19b5..b257315bc2bc 100644 --- a/tests/issues/GH589.test.ts +++ b/tests/issues/GH589.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Reference, IdentifiedReference } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Reference, IdentifiedReference } from '@mikro-orm/postgresql'; @Entity() export class User { @@ -35,13 +34,12 @@ export class Chat { describe('GH issue 589', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, Chat], dbName: `mikro_orm_test_gh_589`, - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH603.test.ts b/tests/issues/GH603.test.ts index bc48b9e6881e..f0255e88dac0 100644 --- a/tests/issues/GH603.test.ts +++ b/tests/issues/GH603.test.ts @@ -1,5 +1,4 @@ -import { Collection, EntitySchema, OptionalProps } from '@mikro-orm/core'; -import { MikroORM } from '@mikro-orm/mysql'; +import { Collection, EntitySchema, MikroORM, OptionalProps } from '@mikro-orm/mysql'; import { v4 } from 'uuid'; class TaskProps { diff --git a/tests/issues/GH610.test.ts b/tests/issues/GH610.test.ts index 1c3a89651d07..04e6a43247f3 100644 --- a/tests/issues/GH610.test.ts +++ b/tests/issues/GH610.test.ts @@ -1,7 +1,5 @@ -import { Entity, PrimaryKey, ManyToOne, IdentifiedReference, Property, MikroORM, wrap, ObjectBindingPattern } from '@mikro-orm/core'; -import type { AbstractSqlDriver } from '@mikro-orm/knex'; +import { Entity, PrimaryKey, ManyToOne, IdentifiedReference, Property, MikroORM, wrap, ObjectBindingPattern } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; @Entity() export class Test { @@ -23,13 +21,12 @@ export class Test { describe('GH issue 610', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Test], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.dropSchema(); await orm.schema.createSchema(); diff --git a/tests/issues/GH755.test.ts b/tests/issues/GH755.test.ts index 81a7274aec7b..7f81233c7891 100644 --- a/tests/issues/GH755.test.ts +++ b/tests/issues/GH755.test.ts @@ -1,6 +1,4 @@ -import type { Options } from '@mikro-orm/core'; -import { EntitySchema, MikroORM } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { EntitySchema, MikroORM } from '@mikro-orm/sqlite'; export class Test { @@ -33,8 +31,7 @@ describe('GH issue 755', () => { const options = { entities: [TestSchema], dbName: ':memory:', - driver: SqliteDriver, - } as Options; + }; const err = `Entity Test has wrong index definition: 'created_at' does not exist. You need to use property name, not column name.`; await expect(MikroORM.init(options)).rejects.toThrowError(err); }); diff --git a/tests/issues/GH811.test.ts b/tests/issues/GH811.test.ts index cb311414f9df..225d5e2489a0 100644 --- a/tests/issues/GH811.test.ts +++ b/tests/issues/GH811.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/core'; -import { PostgreSqlDriver } from '@mikro-orm/postgresql'; +import { Entity, MikroORM, OneToOne, PrimaryKey, Property } from '@mikro-orm/postgresql'; import { v4 } from 'uuid'; @Entity() @@ -43,13 +42,12 @@ export class Employee { describe('GH issue 811', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Contact, Employee, Address], dbName: 'mikro_orm_test_gh811', - driver: PostgreSqlDriver, }); await orm.schema.refreshDatabase(); }); diff --git a/tests/issues/GH893.test.ts b/tests/issues/GH893.test.ts index 090ad427276f..83733b16f609 100644 --- a/tests/issues/GH893.test.ts +++ b/tests/issues/GH893.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, OneToMany, ManyToOne, Collection, BeforeCreate } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, OneToMany, ManyToOne, Collection, BeforeCreate } from '@mikro-orm/sqlite'; import { v4 } from 'uuid'; abstract class Base { @@ -32,13 +31,12 @@ class Book extends Base { describe('GH issue 893', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [Base, Book, Publisher], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH910.test.ts b/tests/issues/GH910.test.ts index 45fe2addf840..6c0db81c4a12 100644 --- a/tests/issues/GH910.test.ts +++ b/tests/issues/GH910.test.ts @@ -1,7 +1,6 @@ -import type { Platform } from '@mikro-orm/core'; -import { Cascade, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Property, Type } from '@mikro-orm/core'; +import type { Platform } from '@mikro-orm/sqlite'; +import { Cascade, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, PrimaryKeyType, Property, Type } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; -import { SqliteDriver } from '@mikro-orm/sqlite'; export class Sku { @@ -87,7 +86,6 @@ describe('GH issue 910', () => { test(`composite keys with custom type PK that uses object value`, async () => { const orm = await MikroORM.init({ entities: [Cart, CartItem], - driver: SqliteDriver, dbName: ':memory:', }); await orm.schema.createSchema(); diff --git a/tests/issues/GH915.test.ts b/tests/issues/GH915.test.ts index 0ee31d3ad1b9..2eb05354fe31 100644 --- a/tests/issues/GH915.test.ts +++ b/tests/issues/GH915.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, OneToOne, PrimaryKey, PrimaryKeyType } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, OneToOne, PrimaryKey, PrimaryKeyType } from '@mikro-orm/sqlite'; @Entity() export class A { @@ -26,7 +25,6 @@ describe('GH issue 915', () => { beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], - driver: SqliteDriver, dbName: ':memory:', }); await orm.schema.createSchema(); diff --git a/tests/issues/GH940.test.ts b/tests/issues/GH940.test.ts index d47f0f62beca..7f01bc68d1c9 100644 --- a/tests/issues/GH940.test.ts +++ b/tests/issues/GH940.test.ts @@ -1,5 +1,4 @@ -import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { BigIntType, Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; import { mockLogger } from '../helpers'; @Entity() @@ -34,13 +33,12 @@ class UserOrganization { describe('GH issue 940, 1117', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [User, UserOrganization], dbName: `:memory:`, - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GH949.test.ts b/tests/issues/GH949.test.ts index fe3addb4f90a..391b3dfb4743 100644 --- a/tests/issues/GH949.test.ts +++ b/tests/issues/GH949.test.ts @@ -1,5 +1,4 @@ -import { Entity, MikroORM, PrimaryKey, OneToMany, ManyToOne, Collection, ValidationError, ArrayCollection } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Entity, MikroORM, PrimaryKey, OneToMany, ManyToOne, Collection, ValidationError, ArrayCollection } from '@mikro-orm/sqlite'; @Entity() class A { @@ -23,13 +22,12 @@ class B { } describe('GH issue 949', () => { - let orm: MikroORM; + let orm: MikroORM; beforeAll(async () => { orm = await MikroORM.init({ entities: [A, B], dbName: ':memory:', - driver: SqliteDriver, }); await orm.schema.createSchema(); }); diff --git a/tests/issues/GHx2.test.ts b/tests/issues/GHx2.test.ts index 26ffed1ede3b..207193ccf6a7 100644 --- a/tests/issues/GHx2.test.ts +++ b/tests/issues/GHx2.test.ts @@ -1,5 +1,4 @@ -import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'; -import { SqliteDriver } from '@mikro-orm/sqlite'; +import { Collection, Entity, ManyToOne, MikroORM, OneToMany, PrimaryKey, Property } from '@mikro-orm/sqlite'; @Entity() @@ -42,7 +41,6 @@ export class Book { test(`default value for relation property`, async () => { const orm = await MikroORM.init({ entities: [Author, Book], - driver: SqliteDriver, dbName: ':memory:', }); await orm.schema.refreshDatabase();