Skip to content

Commit 06b0392

Browse files
committed
Update travis config
1 parent 35596fd commit 06b0392

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
language: node_js
22
node_js:
3+
- "0.8"
34
- "0.10"
5+
- "0.11"
46
before_script:
7+
- npm install npm --global
58
- node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres

Makefile

+3-13
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ params := $(connectionString)
77
node-command := xargs -n 1 -I file node file $(params)
88

99
.PHONY : test test-connection test-integration bench test-native \
10-
build/default/binding.node jshint upgrade-pg publish test-missing-native
10+
jshint publish test-missing-native update-npm
1111

1212
all:
1313
npm install
1414

15-
build:
16-
node-gyp rebuild
17-
1815
help:
1916
@echo "make prepare-test-db [connectionString=postgres://<your connection string>]"
2017
@echo "make test-all [connectionString=postgres://<your connection string>]"
@@ -23,12 +20,9 @@ test: test-unit
2320

2421
test-all: jshint test-missing-native test-unit test-integration test-native test-binary
2522

26-
test-travis: test-all upgrade-pg
27-
#@make test-all connectionString=postgres://postgres@localhost:5433/postgres
2823

29-
upgrade-pg:
30-
#@chmod 755 script/travis-pg-9.2-install.sh
31-
#@./script/travis-pg-9.2-install.sh
24+
udpate-npm:
25+
@npm i npm --global
3226

3327
bench:
3428
@find benchmark -name "*-bench.js" | $(node-command)
@@ -75,7 +69,3 @@ prepare-test-db:
7569
jshint:
7670
@echo "***Starting jshint***"
7771
@./node_modules/.bin/jshint lib
78-
79-
publish:
80-
@rm -r build || (exit 0)
81-
@npm publish

lib/native/index.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var EventEmitter = require('events').EventEmitter;
66
var util = require('util');
77
var ConnectionParameters = require(__dirname + '/../connection-parameters');
88

9-
var msg = 'Version >= ' + pkg.minNativeVersion + ' of pg-native required.'
9+
var msg = 'Version >= ' + pkg.minNativeVersion + ' of pg-native required.';
1010
assert(semver.gte(Native.version, pkg.minNativeVersion), msg);
1111

1212
var NativeQuery = require('./query');
@@ -84,6 +84,16 @@ Client.prototype.connect = function(cb) {
8484
});
8585
};
8686

87+
//send a query to the server
88+
//this method is highly overloaded to take
89+
//1) string query, optional array of parameters, optional function callback
90+
//2) object query with {
91+
// string query
92+
// optional array values,
93+
// optional function callback instead of as a separate parameter
94+
// optional string name to name & cache the query plan
95+
// optional string rowMode = 'array' for an array of results
96+
// }
8797
Client.prototype.query = function(config, values, callback) {
8898
var query = new NativeQuery(this.native);
8999

@@ -118,6 +128,7 @@ Client.prototype.query = function(config, values, callback) {
118128
return query;
119129
};
120130

131+
//disconnect from the backend server
121132
Client.prototype.end = function(cb) {
122133
var self = this;
123134
if(!this._connected) {
@@ -161,6 +172,7 @@ Client.prototype._pulseQueryQueue = function(initialConnection) {
161172
});
162173
};
163174

175+
//attempt to cancel an in-progress query
164176
Client.prototype.cancel = function(query) {
165177
if(this._activeQuery == query) {
166178
this.native.cancel(function() {});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"minNativeVersion": "1.6.0",
3535
"scripts": {
3636
"changelog": "npm i github-changes && ./node_modules/.bin/github-changes -o brianc -r node-postgres -d pulls -a -v",
37-
"test": "make test-travis connectionString=postgres://postgres@localhost:5432/postgres"
37+
"test": "make test-all connectionString=postgres://postgres@localhost:5432/postgres"
3838
},
3939
"engines": {
4040
"node": ">= 0.8.0"

0 commit comments

Comments
 (0)