2010-09-29 12:18:46 +08:00
|
|
|
var EventEmitter = require('events').EventEmitter;
|
|
|
|
var sys = require('sys');
|
|
|
|
var net = require('net');
|
|
|
|
|
2010-11-15 13:04:41 +08:00
|
|
|
var Client = require(__dirname+'/client');
|
|
|
|
|
|
|
|
var connect = function(config, callback) {
|
|
|
|
var client = new Client(config);
|
|
|
|
client.connect();
|
|
|
|
var onError = function() {
|
|
|
|
|
|
|
|
};
|
|
|
|
client.once('error', onError);
|
|
|
|
client.connection.once('readyForQuery', function() {
|
|
|
|
callback
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2010-09-29 12:18:46 +08:00
|
|
|
module.exports = {
|
2010-11-15 13:04:41 +08:00
|
|
|
Client: Client
|
|
|
|
Connection: require(__dirname + '/connection'),
|
|
|
|
connect: connect
|
2010-09-29 12:18:46 +08:00
|
|
|
};
|