Skip to content

Commit 65faa53

Browse files
committed
Update README and create CHANGELOG to reflect new connection parameters
1 parent 3ae70bf commit 65faa53

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## 3.0.0
2+
3+
Thanks to @billwashere, we upgraded to a more modern version of `pg` (4.5.1 ->
4+
7.4.1), which means that the way the database information is provided has
5+
changed. Previously, you could pass a URL to sharedb-postgres, like:
6+
7+
```js
8+
const db = require('sharedb-postgres')('postgres://localhost/mydb');
9+
```
10+
11+
This is no longer supported, and you must instead pass a config object:
12+
13+
```js
14+
const db = require('sharedb-postgres')({host: 'localhost', database: 'mydb'});
15+
```
16+
17+
See the [node-postgres](https://node-postgres.com/features/connecting)
18+
documentation for more details about what can be passed in the config object.
19+
Additionally, if no object is provided, `pg` will use the same environment
20+
variables as `libpq` (`PGUSER`, `PGHOST` and so on).

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ To instantiate a sharedb-postgres wrapper, invoke the module and pass in your
1616
PostgreSQL configuration as an argument. For example:
1717

1818
```js
19-
var db = require('sharedb-postgres')('postgres://localhost/mydb');
19+
var db = require('sharedb-postgres')({host: 'localhost', database: 'mydb'});
2020
var backend = require('sharedb')({db: db})
2121
```
2222

2323
## Error codes
2424

2525
PostgreSQL errors are passed back directly.
26+
27+
## Changelog
28+
29+
Note that version 3.0.0 introduces breaking changes in how you specify
30+
connection parameters. See the [changelog](CHANGELOG.md) for more info.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sharedb-postgres",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"description": "PostgreSQL adapter for ShareDB",
55
"main": "index.js",
66
"scripts": {
@@ -14,4 +14,4 @@
1414
"pg": "^7.4.1",
1515
"sharedb": "^1.0.0-beta.7"
1616
}
17-
}
17+
}

0 commit comments

Comments
 (0)