Skip to content

Commit

Permalink
refactor: better naming (ExecuteOrQueryResultPackets -> QueryResult)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikelborm committed Mar 1, 2024
1 parent 5fa4324 commit d44bf83
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion typings/mysql/lib/protocol/packets/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
10 changes: 5 additions & 5 deletions typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
FieldPacket,
ExecuteOrQueryResultPackets,
QueryResult,
} from '../packets/index.js';
import {
Query,
Expand All @@ -13,26 +13,26 @@ export declare function ExecutableBase<T extends QueryableConstructor>(
Base?: T
): {
new (...args: any[]): {
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
sql: string,
callback?:
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined
): Query;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
sql: string,
values: any,
callback?:
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined
): Query;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
options: QueryOptions,
callback?:
| ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any)
| undefined
): Query;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
options: QueryOptions,
values: any,
callback?:
Expand Down
10 changes: 5 additions & 5 deletions typings/mysql/lib/protocol/sequences/QueryableBase.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
FieldPacket,
ExecuteOrQueryResultPackets,
QueryResult,
} from '../packets/index.js';
import {
Query,
Expand All @@ -13,26 +13,26 @@ export declare function QueryableBase<T extends QueryableConstructor>(
Base?: T
): {
new (...args: any[]): {
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
sql: string,
callback?:
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined
): Query;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
sql: string,
values: any,
callback?:
| ((err: QueryError | null, result: T, fields: FieldPacket[]) => any)
| undefined
): Query;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
options: QueryOptions,
callback?:
| ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any)
| undefined
): Query;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
options: QueryOptions,
values: any,
callback?:
Expand Down
10 changes: 5 additions & 5 deletions typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import {
FieldPacket,
ExecuteOrQueryResultPackets,
QueryResult,
} from '../../packets/index.js';
import { QueryOptions, QueryableConstructor } from '../Query.js';

export declare function ExecutableBase<T extends QueryableConstructor>(
Base?: T
): {
new (...args: any[]): {
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
sql: string
): Promise<[T, FieldPacket[]]>;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
sql: string,
values: any
): Promise<[T, FieldPacket[]]>;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
options: QueryOptions
): Promise<[T, FieldPacket[]]>;
execute<T extends ExecuteOrQueryResultPackets>(
execute<T extends QueryResult>(
options: QueryOptions,
values: any
): Promise<[T, FieldPacket[]]>;
Expand Down
10 changes: 5 additions & 5 deletions typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import {
FieldPacket,
ExecuteOrQueryResultPackets,
QueryResult,
} from '../../packets/index.js';
import { QueryOptions, QueryableConstructor } from '../Query.js';

export declare function QueryableBase<T extends QueryableConstructor>(
Base?: T
): {
new (...args: any[]): {
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
sql: string
): Promise<[T, FieldPacket[]]>;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
sql: string,
values: any
): Promise<[T, FieldPacket[]]>;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
options: QueryOptions
): Promise<[T, FieldPacket[]]>;
query<T extends ExecuteOrQueryResultPackets>(
query<T extends QueryResult>(
options: QueryOptions,
values: any
): Promise<[T, FieldPacket[]]>;
Expand Down

0 comments on commit d44bf83

Please sign in to comment.