artmapper
Version:
A simple and intuitive ORM for Node.js with TypeScript and JavaScript support
80 lines • 1.71 kB
TypeScript
import { DatabaseConfig, DatabaseType } from './types';
export declare class DatabaseConnection {
private config;
private connection;
private type;
constructor(config: DatabaseConfig);
/**
* Connect to the database
*/
connect(): Promise<void>;
/**
* Execute a query
*/
query(sql: string, params?: any[]): Promise<any>;
/**
* Get database type
*/
getType(): DatabaseType;
/**
* Close the connection
*/
close(): Promise<void>;
/**
* Connect to MySQL
*/
private connectMySQL;
/**
* Connect to PostgreSQL
*/
private connectPostgreSQL;
/**
* Connect to SQLite
*/
private connectSQLite;
/**
* Connect to MongoDB
*/
private connectMongoDB;
/**
* Build MongoDB connection URL
*/
private buildMongoURL;
/**
* Execute MySQL query with proper result handling
*/
private executeMySQLQuery;
/**
* Execute PostgreSQL query with proper result handling
*/
private executePostgreSQLQuery;
/**
* Execute SQLite query with proper result handling
*/
private executeSQLiteQuery;
/**
* Execute MongoDB query (simplified)
*/
private executeMongoQuery;
/**
* Create a table based on model definition
*/
createTable(definition: any): Promise<void>;
/**
* Map field type to SQL type
*/
private mapFieldTypeToSQL;
/**
* Quote a field name
*/
private quoteField;
/**
* Quote a table name
*/
private quoteTable;
/**
* Quote a value
*/
private quoteValue;
}
//# sourceMappingURL=connection.d.ts.map