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
23 lines
666 B
JavaScript
23 lines
666 B
JavaScript
'use strict'
|
|
var helper = require('./test-helper')
|
|
const pool = new helper.pg.Pool()
|
|
|
|
pool.connect(assert.success(function (client, done) {
|
|
var types = require('pg-types')
|
|
// 1231 = numericOID
|
|
types.setTypeParser(1700, function () {
|
|
return 'yes'
|
|
})
|
|
types.setTypeParser(1700, 'binary', function () {
|
|
return 'yes'
|
|
})
|
|
var bignum = '294733346389144765940638005275322203805'
|
|
client.query('CREATE TEMP TABLE bignumz(id numeric)')
|
|
client.query('INSERT INTO bignumz(id) VALUES ($1)', [bignum])
|
|
client.query('SELECT * FROM bignumz', assert.success(function (result) {
|
|
assert.equal(result.rows[0].id, 'yes')
|
|
done()
|
|
pool.end()
|
|
}))
|
|
}))
|