mirror of
https://github.com/mariadb-corporation/mariadb-connector-nodejs.git
synced 2025-08-01 16:02:59 +00:00
23 lines
545 B
JavaScript
23 lines
545 B
JavaScript
"use strict";
|
|
|
|
let Connection = require("./lib/connection.js");
|
|
let ConnOptions = require("./lib/config/connection-options.js");
|
|
|
|
module.exports.createConnection = function createConnection(opts) {
|
|
try {
|
|
let connOptions = new ConnOptions(opts);
|
|
const conn = new Connection(connOptions);
|
|
return conn.connect();
|
|
} catch (err) {
|
|
return Promise.reject(err);
|
|
}
|
|
};
|
|
//
|
|
// exports.createPool = function createPool(config) {
|
|
// //TODO
|
|
// };
|
|
//
|
|
// exports.createPoolCluster = function createPoolCluster(config) {
|
|
// //TODO
|
|
// };
|