script for debugging of text version of type output

This commit is contained in:
brianc 2010-10-27 18:49:56 -05:00
parent 05ba85ae79
commit 30246c16d5

23
script/dump-db-types.js Normal file
View File

@ -0,0 +1,23 @@
var pg = require(__dirname + '/../lib');
var args = require(__dirname + '/../test/cli');
var queries = [
"select CURRENT_TIMESTAMP",
"select interval '1 day' + interval '1 hour'",
"select TIMESTAMP 'today'"];
queries.forEach(function(query) {
var client = new pg.Client({
user: args.user,
database: args.database,
password: args.password
});
client.connect();
client
.query(query)
.on('row', function(row) {
console.log(row);
client.end();
});
});