changed Connection#startupMessage to Connection#startup
This commit is contained in:
parent
e89aa9c84c
commit
d927e7e3f5
@ -37,7 +37,7 @@ p.connect = function() {
|
|||||||
con.connect(this.port, this.host);
|
con.connect(this.port, this.host);
|
||||||
|
|
||||||
con.on('connect', function() {
|
con.on('connect', function() {
|
||||||
con.startupMessage({
|
con.startup({
|
||||||
user: self.user,
|
user: self.user,
|
||||||
database: self.database
|
database: self.database
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ p.connect = function(port, host) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
p.startupMessage = function(config) {
|
p.startup = function(config) {
|
||||||
var buffer = new BufferList()
|
var buffer = new BufferList()
|
||||||
.addInt16(3)
|
.addInt16(3)
|
||||||
.addInt16(0)
|
.addInt16(0)
|
||||||
|
@ -43,7 +43,7 @@ var people
|
|||||||
con.connect(config.port, config.host);
|
con.connect(config.port, config.host);
|
||||||
con.on('connect', function() {
|
con.on('connect', function() {
|
||||||
console.log('connected');
|
console.log('connected');
|
||||||
con.startupMessage({
|
con.startup({
|
||||||
user: config.user,
|
user: config.user,
|
||||||
database: config.database
|
database: config.database
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ var con = new Connection({stream: new net.Stream()});
|
|||||||
con.connect('5432', 'localhost');
|
con.connect('5432', 'localhost');
|
||||||
|
|
||||||
con.on('connect', function() {
|
con.on('connect', function() {
|
||||||
con.startupMessage({
|
con.startup({
|
||||||
user: 'brian',
|
user: 'brian',
|
||||||
database: 'postgres'
|
database: 'postgres'
|
||||||
});
|
});
|
||||||
|
@ -10,7 +10,7 @@ var authConnect = function(username, database, callback) {
|
|||||||
var connection = new Connection({stream: new net.Stream()});
|
var connection = new Connection({stream: new net.Stream()});
|
||||||
connection.connect('5432','localhost');
|
connection.connect('5432','localhost');
|
||||||
connection.once('connect', function() {
|
connection.once('connect', function() {
|
||||||
connection.startupMessage({
|
connection.startup({
|
||||||
user: username,
|
user: username,
|
||||||
database: database
|
database: database
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@ assert.recieved = function(stream, buffer) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test("sends startup message", function() {
|
test("sends startup message", function() {
|
||||||
con.startupMessage({
|
con.startup({
|
||||||
user: 'brian',
|
user: 'brian',
|
||||||
database: 'bang'
|
database: 'bang'
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user