1- import { type Connection as CallbackConnection , createPool , type Pool as CallbackPool , type PoolOptions } from 'mysql2' ;
2- import type { Connection , Pool } from 'mysql2/promise' ;
1+ import type { Connection as CallbackConnection , Pool as CallbackPool } from 'mysql2' ;
2+ import { type Connection , createPool , type Pool , type PoolOptions } from 'mysql2/promise' ;
33import * as V1 from '~/_relations.ts' ;
44import type { Cache } from '~/cache/core/index.ts' ;
55import { entityKind } from '~/entity.ts' ;
@@ -61,12 +61,12 @@ export type MySql2DrizzleConfig<
6161function construct <
6262 TSchema extends Record < string , unknown > = Record < string , never > ,
6363 TRelations extends AnyRelations = EmptyRelations ,
64- TClient extends Pool | Connection | CallbackPool | CallbackConnection = CallbackPool ,
64+ TClient extends Pool | Connection | CallbackPool | CallbackConnection = Pool ,
6565> (
6666 client : TClient ,
6767 config : MySql2DrizzleConfig < TSchema , TRelations > = { } ,
6868) : MySql2Database < TSchema , TRelations > & {
69- $client : AnyMySql2Connection extends TClient ? CallbackPool : TClient ;
69+ $client : AnyMySql2Connection extends TClient ? Pool : TClient ;
7070} {
7171 const dialect = new MySqlDialect ( { casing : config . casing } ) ;
7272 let logger ;
@@ -132,7 +132,7 @@ export type AnyMySql2Connection = Pool | Connection | CallbackPool | CallbackCon
132132export function drizzle <
133133 TSchema extends Record < string , unknown > = Record < string , never > ,
134134 TRelations extends AnyRelations = EmptyRelations ,
135- TClient extends AnyMySql2Connection = CallbackPool ,
135+ TClient extends AnyMySql2Connection = Pool ,
136136> (
137137 ...params : [
138138 string ,
@@ -150,7 +150,7 @@ export function drizzle<
150150 ) ,
151151 ]
152152) : MySql2Database < TSchema , TRelations > & {
153- $client : AnyMySql2Connection extends TClient ? CallbackPool : TClient ;
153+ $client : AnyMySql2Connection extends TClient ? Pool : TClient ;
154154} {
155155 if ( typeof params [ 0 ] === 'string' ) {
156156 const connectionString = params [ 0 ] ! ;
0 commit comments