var ConnectionPool = require('any-db-pool')
var parseDbUrl     = require('parse-db-url')

Object.defineProperty(exports, 'adapters', {
  get: function () {
    throw new Error(
      "Replace require('any-db').adapters.<blah> with require('any-db-<blah>')"
    )
  }
})

exports.createConnection = function connect (dbUrl, callback) {
  var adapterConfig = parseDbUrl(dbUrl)
  var adapter = getAdapter(adapterConfig.adapter)
  var conn = adapter.createConnection(adapterConfig, callback);
  conn.adapter = adapterConfig.adapter
  return conn
}

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)
}

function getAdapter (protocol) {
  var name = protocol.replace(':', '').split('+').shift()
  return require('any-db-' + name)
}

@@ -607,650 +607,46 @@
 %7B%0A  
-poolConfig = poolConfig %7C%7C %7B%7D%0A  if (poolConfig.create %7C%7C poolConfig.destroy) %7B%0A    throw new Error(%0A      %22Use onConnect/reset options instead of create/destroy.%22%0A    )%0A  %7D%0A  var adapterConfig = parseDbUrl(dbUrl);%0A  %0A  if (adapterConfig.adapter === 'sqlite3' && /:memory:$/i.test(adapterConfig.database)) %7B%0A    if (poolConfig.min %3E 1 %7C%7C poolConfig.max %3E 1) %7B%0A      console.warn(%0A        %22Pools of more than 1 connection do not work for in-memory SQLite3 databases%5Cn%22 +%0A        %22The specified minimum (%25d) and maximum (%25d) connections have been overridden%22%0A      )%0A    %7D%0A    if (poolConfig.min) poolConfig.min = 1%0A    poolConfig.max = 1%0A  %7D%0A  
+var adapterConfig = parseDbUrl(dbUrl);
 %0A  v

remove code that belongs to any-db-pool