Skip to content

Commit

Permalink
remove code that belongs to any-db-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
grncdr committed Dec 22, 2013
1 parent 8616c6b commit 48222a1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions index.js
Expand Up @@ -18,25 +18,7 @@ exports.createConnection = function connect (dbUrl, callback) {
}

exports.createPool = function createPool (dbUrl, poolConfig) {
poolConfig = poolConfig || {}
if (poolConfig.create || poolConfig.destroy) {
throw new Error(
"Use onConnect/reset options instead of create/destroy."
)
}
var adapterConfig = parseDbUrl(dbUrl);

if (adapterConfig.adapter === 'sqlite3' && /:memory:$/i.test(adapterConfig.database)) {
if (poolConfig.min > 1 || poolConfig.max > 1) {
console.warn(
"Pools of more than 1 connection do not work for in-memory SQLite3 databases\n" +
"The specified minimum (%d) and maximum (%d) connections have been overridden"
)
}
if (poolConfig.min) poolConfig.min = 1
poolConfig.max = 1
}

var adapter = getAdapter(adapterConfig.adapter)
return new ConnectionPool(adapter, adapterConfig, poolConfig)
}
Expand Down

0 comments on commit 48222a1

Please sign in to comment.