diff --git a/typings/mysql/lib/protocol/sequences/Query.d.ts b/typings/mysql/lib/protocol/sequences/Query.d.ts index a2d2ada6fa..6c03ce4ce0 100644 --- a/typings/mysql/lib/protocol/sequences/Query.d.ts +++ b/typings/mysql/lib/protocol/sequences/Query.d.ts @@ -3,6 +3,17 @@ import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js'; import { Readable } from 'stream'; import { TypeCast } from '../../parsers/typeCast.js'; +export type QueryValues = + | string + | number + | bigint + | boolean + | Date + | null + | Blob + | Buffer + | ({} | null)[]; + export interface QueryOptions { /** * The SQL for the query @@ -12,7 +23,7 @@ export interface QueryOptions { /** * The values for the query */ - values?: any | any[] | { [param: string]: any }; + values?: QueryValues; /** * This overrides the namedPlaceholders option set at the connection level. diff --git a/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts b/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts index d96602cf42..1970688179 100644 --- a/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts @@ -1,5 +1,5 @@ import { FieldPacket, QueryResult } from '../../packets/index.js'; -import { QueryOptions, QueryableConstructor } from '../Query.js'; +import { QueryOptions, QueryableConstructor, QueryValues } from '../Query.js'; export declare function ExecutableBase( Base?: T @@ -8,14 +8,14 @@ export declare function ExecutableBase( execute(sql: string): Promise<[T, FieldPacket[]]>; execute( sql: string, - values: any + values: QueryValues ): Promise<[T, FieldPacket[]]>; execute( options: QueryOptions ): Promise<[T, FieldPacket[]]>; execute( options: QueryOptions, - values: any + values: QueryValues ): Promise<[T, FieldPacket[]]>; }; } & T;