start working on parsing

This commit is contained in:
brianc 2010-10-23 12:58:40 -05:00
parent bfec84bc15
commit 380abbf6a6
3 changed files with 34 additions and 1 deletions

View File

@ -109,6 +109,10 @@ p.query = function(text) {
return this;
};
p.parse = function(text, types) {
};
p.pulseQueryQueue = function(ready) {
if(!this.readyForQuery) {
return;

View File

@ -1 +1,28 @@
require(__dirname+"/test-helper");
//http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
var client = createClient();
client.stream.emit('data', buffers.readyForQuery());
//client sends parse message
test('prepared queries', function() {
test("parse messages", function() {
test('parsing a query with no parameters', function() {
client.parse('!');
assert.length(client.stream.packets, 1);
});
});
//server raises parse complete message
test('sends bind message', function() {
return false;
});
test('recieves rows', function() {
return false;
});
});

View File

@ -77,6 +77,8 @@ buffers.error = function(fields) {
return buf.join(true, 'E');
};
buffers.parseComplete = function() {
return new BufferList().join(true, '1');
};
module.exports = buffers;