From d44bf83290490114bb5e5bee2d25bc2852b710fd Mon Sep 17 00:00:00 2001 From: nikelborm Date: Fri, 1 Mar 2024 07:21:19 +0300 Subject: [PATCH] refactor: better naming (ExecuteOrQueryResultPackets -> QueryResult) --- typings/mysql/lib/protocol/packets/index.d.ts | 2 +- .../mysql/lib/protocol/sequences/ExecutableBase.d.ts | 10 +++++----- .../mysql/lib/protocol/sequences/QueryableBase.d.ts | 10 +++++----- .../lib/protocol/sequences/promise/ExecutableBase.d.ts | 10 +++++----- .../lib/protocol/sequences/promise/QueryableBase.d.ts | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/typings/mysql/lib/protocol/packets/index.d.ts b/typings/mysql/lib/protocol/packets/index.d.ts index 974a82e267..352abd250a 100644 --- a/typings/mysql/lib/protocol/packets/index.d.ts +++ b/typings/mysql/lib/protocol/packets/index.d.ts @@ -7,7 +7,7 @@ import { ResultSetHeader } from './ResultSetHeader.js'; import { OkPacketParams } from './params/OkPacketParams.js'; import { ErrorPacketParams } from './params/ErrorPacketParams.js'; -export type ExecuteOrQueryResultPackets = +export type QueryResult = | OkPacket | ResultSetHeader | ResultSetHeader[] diff --git a/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts b/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts index 41f445e8dd..5242b03a70 100644 --- a/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts @@ -1,6 +1,6 @@ import { FieldPacket, - ExecuteOrQueryResultPackets, + QueryResult, } from '../packets/index.js'; import { Query, @@ -13,26 +13,26 @@ export declare function ExecutableBase( Base?: T ): { new (...args: any[]): { - execute( + execute( sql: string, callback?: | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) | undefined ): Query; - execute( + execute( sql: string, values: any, callback?: | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) | undefined ): Query; - execute( + execute( options: QueryOptions, callback?: | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) | undefined ): Query; - execute( + execute( options: QueryOptions, values: any, callback?: diff --git a/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts b/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts index 3765ea2d1e..935d948229 100644 --- a/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts @@ -1,6 +1,6 @@ import { FieldPacket, - ExecuteOrQueryResultPackets, + QueryResult, } from '../packets/index.js'; import { Query, @@ -13,26 +13,26 @@ export declare function QueryableBase( Base?: T ): { new (...args: any[]): { - query( + query( sql: string, callback?: | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) | undefined ): Query; - query( + query( sql: string, values: any, callback?: | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) | undefined ): Query; - query( + query( options: QueryOptions, callback?: | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) | undefined ): Query; - query( + query( options: QueryOptions, values: any, callback?: diff --git a/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts b/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts index ebdebb643b..17de50b8be 100644 --- a/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts @@ -1,6 +1,6 @@ import { FieldPacket, - ExecuteOrQueryResultPackets, + QueryResult, } from '../../packets/index.js'; import { QueryOptions, QueryableConstructor } from '../Query.js'; @@ -8,17 +8,17 @@ export declare function ExecutableBase( Base?: T ): { new (...args: any[]): { - execute( + execute( sql: string ): Promise<[T, FieldPacket[]]>; - execute( + execute( sql: string, values: any ): Promise<[T, FieldPacket[]]>; - execute( + execute( options: QueryOptions ): Promise<[T, FieldPacket[]]>; - execute( + execute( options: QueryOptions, values: any ): Promise<[T, FieldPacket[]]>; diff --git a/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts b/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts index 61d7440f5e..c578627cb1 100644 --- a/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts +++ b/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts @@ -1,6 +1,6 @@ import { FieldPacket, - ExecuteOrQueryResultPackets, + QueryResult, } from '../../packets/index.js'; import { QueryOptions, QueryableConstructor } from '../Query.js'; @@ -8,17 +8,17 @@ export declare function QueryableBase( Base?: T ): { new (...args: any[]): { - query( + query( sql: string ): Promise<[T, FieldPacket[]]>; - query( + query( sql: string, values: any ): Promise<[T, FieldPacket[]]>; - query( + query( options: QueryOptions ): Promise<[T, FieldPacket[]]>; - query( + query( options: QueryOptions, values: any ): Promise<[T, FieldPacket[]]>;