Skip to content

Commit

Permalink
fix(knex): rework postgres and mysql dialect imports to fix compilati…
Browse files Browse the repository at this point in the history
…on errors
  • Loading branch information
B4nan committed Apr 12, 2024
1 parent c937060 commit ffdca15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/knex/src/MonkeyPatchable.ts
Expand Up @@ -3,7 +3,7 @@ import Client from 'knex/lib/client';
// @ts-ignore
import QueryExecutioner from 'knex/lib/execution/internal/query-executioner';
// @ts-ignore
import MySqlDialect from 'knex/lib/dialects/mysql';
import MySqlDialect from 'knex/lib/dialects/mysql2';
// @ts-ignore
import MySqlColumnCompiler from 'knex/lib/dialects/mysql/schema/mysql-columncompiler';
// @ts-ignore
Expand All @@ -17,6 +17,8 @@ import MsSqlQueryCompiler from 'knex/lib/dialects/mssql/query/mssql-querycompile
// @ts-ignore
import MsSqlDialect from 'knex/lib/dialects/mssql';
// @ts-ignore
import PostgresDialect from 'knex/lib/dialects/postgres';
// @ts-ignore
import PostgresDialectTableCompiler from 'knex/lib/dialects/postgres/schema/pg-tablecompiler';
// @ts-ignore
import Sqlite3Dialect from 'knex/lib/dialects/sqlite3';
Expand All @@ -41,6 +43,7 @@ export const MonkeyPatchable = {
MsSqlTableCompiler,
MsSqlQueryCompiler,
MsSqlDialect,
PostgresDialect,
PostgresDialectTableCompiler,
Sqlite3Dialect,
Sqlite3DialectTableCompiler,
Expand Down
5 changes: 2 additions & 3 deletions packages/knex/src/dialects/mysql/MySqlKnexDialect.ts
@@ -1,9 +1,8 @@
// @ts-ignore
import MySql2Dialect from 'knex/lib/dialects/mysql2';
import { MonkeyPatchable } from '@mikro-orm/knex';
import { MySqlQueryCompiler } from './MySqlQueryCompiler';
import { MySqlColumnCompiler } from './MySqlColumnCompiler';

export class MySqlKnexDialect extends MySql2Dialect {
export class MySqlKnexDialect extends MonkeyPatchable.MySqlDialect {

queryCompiler() {
// eslint-disable-next-line prefer-rest-params
Expand Down
@@ -1,9 +1,8 @@
// @ts-ignore
import PostgresDialect from 'knex/lib/dialects/postgres';
import { MonkeyPatchable } from '@mikro-orm/knex';
import type { Configuration } from '@mikro-orm/core';
import { PostgreSqlTableCompiler } from './PostgreSqlTableCompiler';

export class PostgreSqlKnexDialect extends PostgresDialect {
export class PostgreSqlKnexDialect extends MonkeyPatchable.PostgresDialect {

ormConfig!: Configuration;

Expand Down

0 comments on commit ffdca15

Please sign in to comment.