Skip to content

Commit 5fb6c1f

Browse files
Merge pull request #1 from softrams/allow-multiple-statements
Allow multiple statements
2 parents 2603c73 + 5322a83 commit 5fb6c1f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports.init = async (cfg) => {
1111
config = cfg;
1212
};
1313

14-
exports.createPool = async (poolName) => {
14+
exports.createPool = async (poolName, allowMultiStatements = false) => {
1515
try {
1616
const srcCfg = config.DATASOURCES[poolName];
1717
if (srcCfg) {
@@ -22,6 +22,7 @@ exports.createPool = async (poolName) => {
2222
password: srcCfg.DB_PASSWORD,
2323
database: srcCfg.DB_DATABASE,
2424
port: srcCfg.PORT,
25+
multipleStatements: allowMultiStatements,
2526
});
2627
console.debug(`MySQL Adapter: Pool ${poolName} created`);
2728
return true;
@@ -35,10 +36,10 @@ exports.createPool = async (poolName) => {
3536
}
3637
};
3738

38-
exports.connect = async (poolName) => {
39+
exports.connect = async (poolName, allowMultiStatements) => {
3940
try {
4041
if (!pools[poolName]) {
41-
await this.createPool(poolName);
42+
await this.createPool(poolName, allowMultiStatements);
4243
}
4344
return pools[poolName];
4445
} catch (err) {

0 commit comments

Comments
 (0)