Skip to content

Commit 81be01b

Browse files
fix(typings): synchronize types of sqlstring (#3047)
* fix: Export types directly from sqlstring dependency Signed-off-by: Scraps <[email protected]> * Revert "fix: Export types directly from sqlstring dependency" This reverts commit f489a97. * refactor: Merged similarly shaped format overloads Signed-off-by: Scraps <[email protected]> * fix: Added "hidden" type definitions provided by sqlstring package Signed-off-by: Scraps <[email protected]> * Added header comments Signed-off-by: Scraps <[email protected]> * refactor: moved header comment Signed-off-by: Scraps <[email protected]> * refactor: typing corrections Signed-off-by: Scraps <[email protected]> * fix: Ran prettier Signed-off-by: Scraps <[email protected]> --------- Signed-off-by: Scraps <[email protected]>
1 parent 3d2327d commit 81be01b

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

typings/mysql/index.d.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* sqlstring types are based on https://www.npmjs.com/package/@types/sqlstring, version 2.3.2
3+
*/
14
import { Pool as BasePool, PoolOptions } from './lib/Pool.js';
25
import {
36
Connection as BaseConnection,
@@ -53,23 +56,21 @@ export function createPool(config: PoolOptions): BasePool;
5356

5457
export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;
5558

56-
export function escape(value: any): string;
57-
58-
export function escapeId(value: any): string;
59-
60-
export function format(sql: string): string;
61-
export function format(
62-
sql: string,
63-
values: any[],
59+
type TimeZone = 'local' | 'Z' | (string & NonNullable<unknown>);
60+
export function escape(
61+
value: any,
6462
stringifyObjects?: boolean,
65-
timeZone?: string,
63+
timeZone?: TimeZone,
6664
): string;
6765

66+
export function escapeId(value: any, forbidQualified?: boolean): string;
67+
68+
export function format(sql: string): string;
6869
export function format(
6970
sql: string,
70-
values: any,
71+
values: any | any[],
7172
stringifyObjects?: boolean,
72-
timeZone?: string,
73+
timeZone?: TimeZone,
7374
): string;
7475

7576
export function raw(sql: string): {

0 commit comments

Comments
 (0)