mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
* Work on converting lib to standard * Finish updating lib * Finish linting lib * Format test files * Add .eslintrc with standard format * Supply full path to eslint bin * Move lint command to package.json * Add eslint as dev dependency
24 lines
506 B
JavaScript
24 lines
506 B
JavaScript
'use strict'
|
|
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()
|
|
})
|
|
})
|