Skip to content

Commit 7b703cc

Browse files
committed
Merge pull request brianc#1 from brianc/master
merge
2 parents 2902929 + 5eb8ba2 commit 7b703cc

File tree

105 files changed

+5082
-2329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5082
-2329
lines changed

.jshintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailing": true,
3+
"indent": 2,
4+
"evil": true
5+
}

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- 0.8
4+
- "0.10"
5+
before_script:
6+
- node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres

Makefile

+39-14
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,70 @@
11
SHELL := /bin/bash
22

3-
user=postgres
4-
password=1234
5-
host=localhost
6-
port=5432
7-
database=postgres
8-
verbose=false
3+
connectionString=postgres://
94

10-
params := -u $(user) --password $(password) -p $(port) -d $(database) -h $(host) --verbose $(verbose)
5+
params := $(connectionString)
116

127
node-command := xargs -n 1 -I file node file $(params)
138

14-
.PHONY : test test-connection test-integration bench test-native build/default/binding.node
9+
.PHONY : test test-connection test-integration bench test-native \
10+
build/default/binding.node jshint upgrade-pg publish
11+
12+
all:
13+
npm install
14+
15+
help:
16+
@echo "make prepare-test-db [connectionString=postgres://<your connection string>]"
17+
@echo "make test-all [connectionString=postgres://<your connection string>]"
18+
1519
test: test-unit
1620

17-
test-all: test-unit test-integration test-native test-binary
21+
test-all: jshint test-unit test-integration test-native test-binary
22+
23+
test-travis: test-all upgrade-pg
24+
@make test-all connectionString=postgres://postgres@localhost:5433/postgres
25+
26+
upgrade-pg:
27+
@chmod 755 script/travis-pg-9.2-install.sh
28+
@./script/travis-pg-9.2-install.sh
1829

1930
bench:
2031
@find benchmark -name "*-bench.js" | $(node-command)
2132

2233
build/default/binding.node:
23-
@node-waf configure build
34+
@node-gyp rebuild
2435

2536
test-unit:
2637
@find test/unit -name "*-tests.js" | $(node-command)
2738

2839
test-connection:
40+
@echo "***Testing connection***"
2941
@node script/test-connection.js $(params)
3042

3143
test-connection-binary:
32-
@node script/test-connection.js $(params) --binary true
44+
@echo "***Testing binary connection***"
45+
@node script/test-connection.js $(params) binary
3346

3447
test-native: build/default/binding.node
3548
@echo "***Testing native bindings***"
3649
@find test/native -name "*-tests.js" | $(node-command)
37-
@find test/integration -name "*-tests.js" | $(node-command) --native true
50+
@find test/integration -name "*-tests.js" | $(node-command) native
3851

39-
test-integration: test-connection
52+
test-integration: test-connection
4053
@echo "***Testing Pure Javascript***"
4154
@find test/integration -name "*-tests.js" | $(node-command)
4255

4356
test-binary: test-connection-binary
4457
@echo "***Testing Pure Javascript (binary)***"
45-
@find test/integration -name "*-tests.js" | $(node-command) --binary true
58+
@find test/integration -name "*-tests.js" | $(node-command) binary
59+
60+
prepare-test-db:
61+
@echo "***Preparing the database for tests***"
62+
@find script/create-test-tables.js | $(node-command)
63+
64+
jshint:
65+
@echo "***Starting jshint***"
66+
@./node_modules/.bin/jshint lib
67+
68+
publish:
69+
@rm -r build || (exit 0)
70+
@npm publish

NEWS.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
All major and minor releases are briefly explained below.
2+
3+
For richer information consult the commit log on github with referenced pull requests.
4+
5+
We do not include break-fix version release in this file.
6+
7+
### v2.5.0
8+
- Ability to opt-in to int8 parsing via `pg.defaults.parseInt8 = true`
9+
10+
### v2.4.0
11+
- Use eval in the result set parser to increase performance
12+
13+
### v2.3.0
14+
- Remove built-in support for binary Int64 parsing.
15+
_Due to the low usage & required compiled dependency this will be pushed into a 3rd party add-on_
16+
17+
### v2.2.0
18+
- [Add support for excapeLiteral and escapeIdentifier in both JavaScript and the native bindings](https://github.com/brianc/node-postgres/pull/396)
19+
20+
### v2.1.0
21+
- Add support for SSL connections in JavaScript driver
22+
- this means you can connect to heroku postgres from your local machine without the native bindings!
23+
- [Add field metadata to result object](https://github.com/brianc/node-postgres/blob/master/test/integration/client/row-description-on-results-tests.js)
24+
- [Add ability for rows to be returned as arrays instead of objects](https://github.com/brianc/node-postgres/blob/master/test/integration/client/results-as-array-tests.js)
25+
26+
### v2.0.0
27+
28+
- Properly handle various PostgreSQL to JavaScript type conversions to avoid data loss:
29+
30+
```
31+
PostgreSQL | pg@v2.0 JavaScript | pg@v1.0 JavaScript
32+
--------------------------------|----------------
33+
float4 | number (float) | string
34+
float8 | number (float) | string
35+
int8 | string | number (int)
36+
numeric | string | number (float)
37+
decimal | string | number (float)
38+
```
39+
40+
For more information see https://github.com/brianc/node-postgres/pull/353
41+
If you are unhappy with these changes you can always [override the built in type parsing fairly easily](https://github.com/brianc/node-pg-parse-float).
42+
43+
### v1.3.0
44+
45+
- Make client_encoding configurable and optional
46+
47+
### v1.2.0
48+
49+
- return field metadata on result object: access via result.fields[i].name/dataTypeID
50+
51+
### v1.1.0
52+
53+
- built in support for `JSON` data type for PostgreSQL Server @ v9.2.0 or greater
54+
55+
### v1.0.0
56+
57+
- remove deprecated functionality
58+
- Callback function passed to `pg.connect` now __requires__ 3 arguments
59+
- Client#pauseDrain() / Client#resumeDrain removed
60+
- numeric, decimal, and float data types no longer parsed into float before being returned. Will be returned from query results as `String`
61+
62+
### v0.15.0
63+
64+
- client now emits `end` when disconnected from back-end server
65+
- if client is disconnected in the middle of a query, query receives an error
66+
67+
### v0.14.0
68+
69+
- add deprecation warnings in prep for v1.0
70+
- fix read/write failures in native module under node v0.9.x

0 commit comments

Comments
 (0)