Skip to content

Commit

Permalink
feat(database): overload connection with new drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Nov 6, 2023
1 parent e6d4c59 commit c01f7da
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/database/DatabaseImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import type { Knex } from 'knex'
import type { Driver } from '#src/drivers/Driver'
import type { Collection, Connection } from 'mongoose'
import { DriverFactory } from '#src/factories/DriverFactory'
import { QueryBuilder } from '#src/database/builders/QueryBuilder'
import { ConnectionFactory } from '#src/factories/ConnectionFactory'
Expand All @@ -35,6 +36,21 @@ export class DatabaseImpl<Client = any, QB = any> {
this.connect(athennaDbOpts)
}

public connection(
connection: 'mongo',
options?: ConnectionOptions
): DatabaseImpl<Connection, Collection>

public connection(
connection: 'mysql',
options?: ConnectionOptions
): DatabaseImpl<Knex, Knex.QueryBuilder>

public connection(
connection: 'sqlite',
options?: ConnectionOptions
): DatabaseImpl<Knex, Knex.QueryBuilder>

public connection(
connection: 'postgres',
options?: ConnectionOptions
Expand Down

0 comments on commit c01f7da

Please sign in to comment.