Commit Graph

40 Commits

Author SHA1 Message Date
T.J. Schuck
e5f0e5d36a s/2016/2017/ (#1291) 2017-05-17 16:47:07 -05:00
Sehrope Sarkuni
ee8193673c Libpq connection string escaping (#1285)
* Fix escaping of libpq connection string properties

Fix handlings of libpq connection properties to properly escape single
quotes and backslashes. Previously the values were surrounded in single
quotes which handled whitespace within the property value, but internal
single quotes and backslashes would cause invalid connection strings to
be generated.

* Update expected output in test to be quoted

Update the expect host output in the connection parameter test
to expect it to be surrounded by single quotes.

* Add test for configs with quotes and backslashes
2017-05-15 12:19:13 -05:00
Kibae Shin
4f790deb73 Support for logical streaming replication (#1271)
* Support for logical streaming replication

* Wrong compare expr in getLibpqConnectionString

* Simplify codes for replication parameter
2017-04-24 13:24:30 -05:00
Ary Purnomoz
4505ae98d9 support ssl params for pg-native (#1169)
Make pg-native able to pass sslmode, sslca, sslkey and sslcert params to libpq
2017-04-19 09:55:56 -05:00
guoxiangyang
33a1c35ad2 changed for self signed ssl support (#1072) 2016-07-10 16:26:36 -05:00
Illirik Smirnov
522d62229b Resolve merge conflict in PR #1041 (#1065)
* Add license comment

* Delete pool.js
2016-06-24 10:56:43 -05:00
Jos Kuijpers
1596a933eb Fix SSL configuration error and add tests. #848 (#1055) 2016-06-21 09:42:30 -05:00
Brian Dunavant
01e5d726da Support for defaults.connectionString (#910) 2016-06-07 16:09:22 -05:00
Joost Farla
f50f5ce7e8 Require statements break Browserify compatibility 2015-10-10 11:10:51 +02:00
Blaine Bublitz
54271a2df3 switch to pg-connection-string module for parsing 2014-07-06 16:39:22 -07:00
Mark Yen
fa17b6882a Include port as a connection parameter for socket connections 2014-06-11 18:18:11 -07:00
Tim Griesser
cd050334ba Removed various unused vars 2014-04-09 08:46:17 -04:00
Brian M. Carlson
779c8064f2 Add domain support to connection pool 2014-03-15 16:41:33 -05:00
Brian M. Carlson
bf0c4bfaa9 Merge branch 'pull/326'
Conflicts:
	lib/connection-parameters.js
	test/unit/connection-parameters/creation-tests.js
2014-02-26 06:10:15 -06:00
Hannes Hörl
7fd79a41c3 Add support for (fallback_)application_name 2014-01-05 18:08:58 +01:00
Hannes Hörl
9ad0159037 merge with upstream 2013-12-22 23:21:42 +01:00
Aurélio A. Heckert
c0fd4b1431 Set database on socket string connection
Allows to conect to a specific database trough this ways:
pg.connect('/some/path database', callback);
pg.connect('socket:/some/path?db=database', callback)
pg.connect('socket:/some/path?db=database&encoding=utf8', callback)
2013-12-19 15:37:26 -03:00
Hannes Hörl
61f8f55d43 Handle .pgpass in the native client 2013-12-11 01:24:55 +01:00
brianc
bfdea752b2 Respect PGSSLMODE for setting SSL connection 2013-09-05 16:51:16 -05:00
Brian C
5806afc8a1 Merge pull request #276 from bryanburgers/connection-url-ssl
Add ssl query string to the connection string parser #275
2013-06-29 23:24:02 -07:00
Dave
6b4bc3945f Uses val function instead 2013-06-06 12:24:12 -07:00
Dave
f658b31aed Changing to client_encoding, adding test for creating a connection 2013-06-06 12:16:36 -07:00
Dave
d69070529c Makes encoding an optional parameter 2013-06-06 12:06:52 -07:00
Hebo
323a2f9f49 Fix client_encoding setting to support pg_bouncer when using libpq (#270) 2013-05-21 14:37:06 -07:00
za-creature
b6ef157e8e Update connection-parameters.js 2013-04-11 23:35:21 +03:00
za-creature
5493a52793 Update connection-parameters.js
Different double-encode removal strategy
2013-04-11 22:32:04 +03:00
za-creature
c666b20287 Update connection-parameters.js
The current connection url handling fails when the password contains
encoded special characters: After the encodeURI, the special
characters from the password are double encoded, and the password is
rejected by postgres.

Proposed fix handles one level of double encoding, and while it
might break compatibility with passwords like "asdfg%77fgh" (which
would've been escaped to asdfg%2577fgh before this patch), I
strongly feel that maintaining backwards compatibility is in this
case less important than following standards and discouraging bad
coding practices.
2013-04-11 19:57:03 +03:00
Andrew Dunstan
ed015f9b58 Fix Unix domain socket setting.
This code was misconceived in that the host parameter for a Unix
domain socket connection must point to the directory containing
the socket, and not to the socket itself. Libpq will look for
the socket based on the host and port settings. See
<http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS>
2013-02-23 11:11:44 -05:00
Bryan Burgers
79f85a4a9e Add ssl query string to the connection string parser 2013-02-20 18:17:18 -06:00
Arkady Emelyanov
4c254e8edf force utf-8 encoding on connect 2013-01-29 20:19:38 -06:00
Francois Payette
77daa06df9 use encodeURI instead of string replace 2013-01-29 19:54:25 -06:00
Brian C
2f75b2f6a9 Merge pull request #256 from booo/jshint
Introduce Jshint
2013-01-24 18:49:05 -08:00
Francois Payette
7d773508fc replace space by %20 in connection string before passing to url.parse 2013-01-24 20:05:55 -05:00
Philipp Borgers
22764e045c fix jshint errors in lib/connection-parameters.js 2013-01-24 22:07:53 +01:00
Philipp Borgers
8e7e2f7a62 remove trailing whitespaces in lib/connection-parameters.js 2013-01-24 22:05:35 +01:00
Philipp Borgers
5e92546a30 fix jshint errors for lib/connection-parameters.js 2013-01-24 21:59:28 +01:00
bmc
9dad56a54e add more functionality to connection parameters 2013-01-21 15:44:55 -06:00
bmc
ec0d0beff2 build libpq connection string & support domain socket 2013-01-21 15:09:44 -06:00
bmc
868a9d0e8d remove node-tap 2013-01-20 19:42:40 -06:00
bmc
92e75f0577 add ConnectionParameters object 2013-01-20 19:42:39 -06:00