1 | import { Pool as BasePool, PoolOptions } from './lib/Pool.js';
|
2 | import {
|
3 | Connection as BaseConnection,
|
4 | ConnectionOptions,
|
5 | SslOptions,
|
6 | } from './lib/Connection.js';
|
7 | import {
|
8 | Query as BaseQuery,
|
9 | QueryOptions,
|
10 | QueryError,
|
11 | } from './lib/protocol/sequences/Query.js';
|
12 | import {
|
13 | PoolCluster as BasePoolCluster,
|
14 | PoolClusterOptions,
|
15 | PoolNamespace,
|
16 | } from './lib/PoolCluster.js';
|
17 | import { PoolConnection as BasePoolConnection } from './lib/PoolConnection.js';
|
18 | import {
|
19 | Prepare as BasePrepare,
|
20 | PrepareStatementInfo,
|
21 | } from './lib/protocol/sequences/Prepare.js';
|
22 | import { Server } from './lib/Server.js';
|
23 |
|
24 | export {
|
25 | ConnectionOptions,
|
26 | SslOptions,
|
27 | PoolOptions,
|
28 | PoolClusterOptions,
|
29 | PoolNamespace,
|
30 | QueryOptions,
|
31 | QueryError,
|
32 | PrepareStatementInfo,
|
33 | };
|
34 |
|
35 | export * from './lib/protocol/packets/index.js';
|
36 | export * from './lib/Auth.js';
|
37 | export * from './lib/constants/index.js';
|
38 | export * from './lib/parsers/index.js';
|
39 |
|
40 |
|
41 | export interface Connection extends BaseConnection {}
|
42 | export interface Pool extends BasePool {}
|
43 | export interface PoolConnection extends BasePoolConnection {}
|
44 | export interface PoolCluster extends BasePoolCluster {}
|
45 | export interface Query extends BaseQuery {}
|
46 | export interface Prepare extends BasePrepare {}
|
47 |
|
48 | export function createConnection(connectionUri: string): BaseConnection;
|
49 | export function createConnection(config: ConnectionOptions): BaseConnection;
|
50 |
|
51 | export function createPool(connectionUri: string): BasePool;
|
52 | export function createPool(config: PoolOptions): BasePool;
|
53 |
|
54 | export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;
|
55 |
|
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[],
|
64 | stringifyObjects?: boolean,
|
65 | timeZone?: string,
|
66 | ): string;
|
67 |
|
68 | export function format(
|
69 | sql: string,
|
70 | values: any,
|
71 | stringifyObjects?: boolean,
|
72 | timeZone?: string,
|
73 | ): string;
|
74 |
|
75 | export function raw(sql: string): {
|
76 | toSqlString: () => string;
|
77 | };
|
78 |
|
79 | export interface ConnectionConfig extends ConnectionOptions {
|
80 | mergeFlags(defaultFlags: string[], userFlags: string[] | string): number;
|
81 | getDefaultFlags(options?: ConnectionOptions): string[];
|
82 | getCharsetNumber(charset: string): number;
|
83 | getSSLProfile(name: string): { ca: string[] };
|
84 | parseUrl(url: string): {
|
85 | host: string;
|
86 | port: number;
|
87 | database: string;
|
88 | user: string;
|
89 | password: string;
|
90 | [key: string]: any;
|
91 | };
|
92 | }
|
93 |
|
94 | export function createServer(handler: (conn: BaseConnection) => any): Server;
|