Skip to main content
Module

x/mysql2/mod.ts>Pool

MySQL client for Deno with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression much more
Latest
class Pool
extends EventEmitter
Re-export
import { Pool } from "https://deno.land/x/mysql2@v1.0.6/mod.ts";

Constructors

new
Pool(options: any)

Properties

_allConnections: Queue<any>
_closed: boolean
_connectionQueue: Queue<any>
_freeConnections: Queue<any>
config: PoolConfig

Methods

_removeConnection(connection: any)
end(cb: any)
escape(value: any)
escapeId(value: any)
execute(
sql?: any,
values?: any,
cb?: any,
)
format(sql: any, values: any)
getConnection(cb: any)
promise(promiseImpl: any)
query(
sql?: any,
values?: any,
cb?: any,
)
interface Pool
implements EventEmitter
Re-export
import { type Pool } from "https://deno.land/x/mysql2@v1.0.6/mod.ts";

Methods

query<T extends >(sql: string): Promise<[T, FieldPacket[]]>
query<T extends >(sql: string, values: any | any[] | { [param: string]: any; }): Promise<[T, FieldPacket[]]>
query<T extends >(options: QueryOptions): Promise<[T, FieldPacket[]]>
query<T extends >(options: QueryOptions, values: any | any[] | { [param: string]: any; }): Promise<[T, FieldPacket[]]>
execute<T extends >(sql: string): Promise<[T, FieldPacket[]]>
execute<T extends >(sql: string, values: any | any[] | { [param: string]: any; }): Promise<[T, FieldPacket[]]>
execute<T extends >(options: QueryOptions): Promise<[T, FieldPacket[]]>
execute<T extends >(options: QueryOptions, values: any | any[] | { [param: string]: any; }): Promise<[T, FieldPacket[]]>
getConnection(): Promise<PoolConnection>
on(event: "connection", listener: (connection: PoolConnection) => any): this
on(event: "acquire", listener: (connection: PoolConnection) => any): this
on(event: "release", listener: (connection: PoolConnection) => any): this
on(event: "enqueue", listener: () => any): this
end(): Promise<void>