2014-09-01 17:18:45 +02:00
|
|
|
'use strict';
|
|
|
|
|
2014-04-08 16:25:57 -04:00
|
|
|
module.exports = function(client) {
|
|
|
|
|
|
|
|
var Pool = require('../../pool');
|
|
|
|
var inherits = require('inherits');
|
2014-04-16 01:23:50 -04:00
|
|
|
var _ = require('lodash');
|
2014-04-08 16:25:57 -04:00
|
|
|
|
|
|
|
// Inherit from the `Pool` constructor's prototype.
|
2014-04-15 11:43:47 -04:00
|
|
|
function Pool_SQLite3() {
|
2014-04-16 01:23:50 -04:00
|
|
|
this.client = client;
|
2014-04-08 16:25:57 -04:00
|
|
|
Pool.apply(this, arguments);
|
|
|
|
}
|
2014-04-15 11:43:47 -04:00
|
|
|
inherits(Pool_SQLite3, Pool);
|
2014-04-08 16:25:57 -04:00
|
|
|
|
2014-04-16 01:23:50 -04:00
|
|
|
Pool_SQLite3.prototype.defaults = function() {
|
|
|
|
return _.extend(Pool.prototype.defaults.call(this), {
|
|
|
|
max: 1,
|
|
|
|
min: 1,
|
|
|
|
destroy: function(client) { client.close(); }
|
|
|
|
});
|
|
|
|
};
|
2014-04-09 10:11:41 -04:00
|
|
|
|
2014-04-08 16:25:57 -04:00
|
|
|
// Assign the newly extended `Pool` constructor to the client object.
|
2014-04-15 11:43:47 -04:00
|
|
|
client.Pool = Pool_SQLite3;
|
2014-04-08 16:25:57 -04:00
|
|
|
|
|
|
|
};
|