mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
code cleanup
This commit is contained in:
parent
ac95c74c66
commit
6d4469e391
@ -17,7 +17,9 @@ var Client = function(config) {
|
||||
|
||||
sys.inherits(Client, EventEmitter);
|
||||
|
||||
Client.prototype.connect = function() {
|
||||
var p = Client.prototype;
|
||||
|
||||
p.connect = function() {
|
||||
if(this.stream.readyState == 'closed'){
|
||||
this.stream.connect(this.port, this.host);
|
||||
}
|
||||
@ -54,12 +56,12 @@ Client.prototype.connect = function() {
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.disconnect = function() {
|
||||
p.disconnect = function() {
|
||||
var terminationBuffer = new Buffer([58,0,0,0,4]);
|
||||
this.stream.write(terminationBuffer);
|
||||
};
|
||||
|
||||
Client.prototype.query = function(text) {
|
||||
p.query = function(text) {
|
||||
var query = new Query();
|
||||
query.client = this;
|
||||
query.text = text;
|
||||
@ -68,7 +70,7 @@ Client.prototype.query = function(text) {
|
||||
return query;
|
||||
};
|
||||
|
||||
Client.prototype.pulseQueryQueue = function() {
|
||||
p.pulseQueryQueue = function() {
|
||||
if(!this.readyForQuery) {
|
||||
return;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user