Skip to content

Commit

Permalink
Merge pull request #541 from brianc/pg-types
Browse files Browse the repository at this point in the history
Break type parsing into separate module
  • Loading branch information
brianc committed Mar 15, 2014
2 parents e8e16f8 + 0254fa5 commit def663d
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 1,093 deletions.
2 changes: 1 addition & 1 deletion lib/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ var defaults = module.exports = {

//parse int8 so you can get your count values as actual numbers
module.exports.__defineSetter__("parseInt8", function(val) {
require('./types').setTypeParser(20, 'text', val ? parseInt : function(val) { return val; });
require('pg-types').setTypeParser(20, 'text', val ? parseInt : function(val) { return val; });
});
3 changes: 1 addition & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var util = require('util');
var Client = require(__dirname+'/client');
var defaults = require(__dirname + '/defaults');
var pool = require(__dirname + '/pool');
var types = require(__dirname + '/types/');
var Connection = require(__dirname + '/connection');

var PG = function(clientConstructor) {
Expand All @@ -12,8 +11,8 @@ var PG = function(clientConstructor) {
this.Client = pool.Client = clientConstructor;
this.Query = this.Client.Query;
this.pools = pool;
this.types = types;
this.Connection = Connection;
this.types = require('pg-types');
};

util.inherits(PG, EventEmitter);
Expand Down
1 change: 0 additions & 1 deletion lib/native/query.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var EventEmitter = require('events').EventEmitter;
var util = require('util');

var types = require(__dirname + '/../types/');
var utils = require(__dirname + '/../utils');
var Result = require(__dirname + '/../result');

Expand Down
1 change: 0 additions & 1 deletion lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var EventEmitter = require('events').EventEmitter;
var util = require('util');

var Result = require(__dirname + '/result');
var Types = require(__dirname + '/types/');
var utils = require(__dirname + '/utils');

var Query = function(config, values, callback) {
Expand Down
2 changes: 1 addition & 1 deletion lib/result.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var types = require(__dirname + '/types/');
var types = require('pg-types');

//result object returned from query
//in the 'end' event and also
Expand Down
97 changes: 0 additions & 97 deletions lib/types/arrayParser.js

This file was deleted.

Loading

0 comments on commit def663d

Please sign in to comment.