Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
///
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
var TIMESTAMPTZ_OID = 1184
var TIMESTAMP_OID = 1114
var parseFn = function(val: any) {
return val === null ? null : moment(val)
}
types.setTypeParser(TIMESTAMPTZ_OID, parseFn)
types.setTypeParser(TIMESTAMP_OID, parseFn)
///
///
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
var TIMESTAMPTZ_OID = 1184
var TIMESTAMP_OID = 1114
var parseFn = function(val: any) {
return val === null ? null : moment(val)
}
types.setTypeParser(TIMESTAMPTZ_OID, parseFn)
types.setTypeParser(TIMESTAMP_OID, parseFn)
///
///
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
var TIMESTAMPTZ_OID = 1184
var TIMESTAMP_OID = 1114
var parseFn = function(val: any) {
return val === null ? null : moment(val)
}
types.setTypeParser(TIMESTAMPTZ_OID, parseFn)
types.setTypeParser(TIMESTAMP_OID, parseFn)
///
///
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
var TIMESTAMPTZ_OID = 1184
var TIMESTAMP_OID = 1114
var parseFn = function(val: any) {
return val === null ? null : moment(val)
}
types.setTypeParser(TIMESTAMPTZ_OID, parseFn)
types.setTypeParser(TIMESTAMP_OID, parseFn)
statement_timeout: false,
// max milliseconds to wait for query to complete (client side)
query_timeout: false,
connect_timeout: 0,
keepalives: 1,
keepalives_idle: 0
}
var pgTypes = require('pg-types')
// save default parsers
var parseBigInteger = pgTypes.getTypeParser(20, 'text')
var parseBigIntegerArray = pgTypes.getTypeParser(1016, 'text')
// parse int8 so you can get your count values as actual numbers
module.exports.__defineSetter__('parseInt8', function (val) {
pgTypes.setTypeParser(20, 'text', val ? pgTypes.getTypeParser(23, 'text') : parseBigInteger)
pgTypes.setTypeParser(1016, 'text', val ? pgTypes.getTypeParser(1007, 'text') : parseBigIntegerArray)
})
// false=unlimited
statement_timeout: false,
// max milliseconds to wait for query to complete (client side)
query_timeout: false,
connect_timeout: 0,
keepalives: 1,
keepalives_idle: 0
}
var pgTypes = require('pg-types')
// save default parsers
var parseBigInteger = pgTypes.getTypeParser(20, 'text')
var parseBigIntegerArray = pgTypes.getTypeParser(1016, 'text')
// parse int8 so you can get your count values as actual numbers
module.exports.__defineSetter__('parseInt8', function (val) {
pgTypes.setTypeParser(20, 'text', val ? pgTypes.getTypeParser(23, 'text') : parseBigInteger)
pgTypes.setTypeParser(1016, 'text', val ? pgTypes.getTypeParser(1007, 'text') : parseBigIntegerArray)
})
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
const TIMESTAMPTZ_OID = 1184;
const TIMESTAMP_OID = 1114;
types.setTypeParser(TIMESTAMPTZ_OID, parseInt);
types.setTypeParser(TIMESTAMP_OID, parseInt);
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
var TIMESTAMPTZ_OID = 1184
var TIMESTAMP_OID = 1114
var parseFn = function(val: any) {
return val === null ? null : moment(val)
}
types.setTypeParser(TIMESTAMPTZ_OID, parseFn)
types.setTypeParser(TIMESTAMP_OID, parseFn)
helper.pg.connect(helper.config, 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')
helper.pg.end();
done();
}))
}));
import * as types from "pg-types";
types.getTypeParser(1184, 'text');
types.setTypeParser(1184, (value) => value === null ? null : value);
types.setTypeParser(1186, 'text', (value) => value === null ? null : value);
types.setTypeParser(1186, 'binary', (value) => value.toISOString());
types.setTypeParser(1185, (value) => types.arrayParser.create(value, (x) => x).parse());
const TIMESTAMPTZ_OID = 1184;
const TIMESTAMP_OID = 1114;
types.setTypeParser(TIMESTAMPTZ_OID, parseInt);
types.setTypeParser(TIMESTAMP_OID, parseInt);