tspace-mysql
Version:
Tspace MySQL is a promise-based ORM for Node.js, designed with modern TypeScript and providing type safety for schema databases.
44 lines (43 loc) • 1.25 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from 'events';
import { loadOptionsEnvironment } from '../options';
import type { TConnection, TNewConnection, TOptions } from '../types';
export declare class PoolConnection extends EventEmitter {
private OPTIONS;
/**
*
* @Init a options connection pool
*/
constructor(options?: TOptions);
/**
*
* Get a connection to database
* @return {Connection} Connection
* @property {Function} Connection.query
* @property {Function} Connection.connection
*/
connected(): TConnection;
newConnected(): TNewConnection;
private _detectEventQuery;
private _detectQueryType;
private _defaultOptions;
private _loadOptions;
private _convertStringToObject;
private _covertKeyTypeToCorrectType;
private _onPoolConnect;
private _messageConnected;
private _messageError;
private _messageSlowQuery;
}
/**
*
* Connection to database when service is started
*
* @returns {Connection} Connection
* @property {Function} Connection.query
* @property {Function} Connection.connection
*/
declare const pool: TConnection;
export { loadOptionsEnvironment };
export { pool as Pool };
export default pool;