Commit Graph

80 Commits

Author SHA1 Message Date
Rod Vagg
6cb167112e convert to NAN for Node 0.8->0.11+ support 2013-12-06 15:30:28 +11:00
Brian C
aea984f7bc Merge pull request #447 from eugeneware/buffer-params
Bind Buffer Variables as binary values (with Native implementation also)
2013-10-02 20:32:03 -07:00
Eugene Ware
badb33af84 Fixes for node 0.8. 2013-10-03 12:47:19 +10:00
Eugene Ware
99f76ca7d2 update error message to reference buffers 2013-09-20 00:57:40 +10:00
Eugene Ware
cd29f806f1 Encode buffers as bytea hex strings 2013-09-20 00:49:38 +10:00
rpedela
b0a4c65567 Surround PGRES_SINGLE_TUPLE with an #ifdef for single row mode support. 2013-09-04 11:50:52 -06:00
rpedela
cd4565ba1f #181 #366 Add support for single row mode in Postgres 9.2+. This will enable single row mode only when the user wants to stream rows. 2013-09-04 11:46:07 -06:00
rpedela
6dffc0c6cd Include version 9.0.0 in escape function check. 2013-07-29 15:49:12 -06:00
rpedela
8129f19409 Include pg_config.h to get PG_VERSION_NUM. 2013-07-29 15:49:12 -06:00
rpedela
cf07a4f2b4 #403 Only use native escape functions if PG version >= 9.0.0. Otherwise use the JS functions. 2013-07-29 15:45:36 -06:00
Brian Carlson
287d7e67a3 Handle NULL return from MallocCString 2013-07-15 09:22:37 -05:00
rpedela
876018e103 Add support for PQescapeLiteral and PQescapeIdentifier. Also add JS versions of the functions. 2013-07-15 09:13:48 -05:00
Brian Carlson
3f96bbbc5c Add field metadata to query result object
Refactored the way rows are built in the native bindings which should
result in a small performance improvement
2013-07-08 09:19:30 -05:00
Brian C
9d773a29c2 Merge pull request #387 from brianc/issues/350
Ensure error being returned to native client
2013-07-08 05:52:25 -07:00
bmc
75181492f2 Fix native quick disconnect hang
Do not initialize connection if connection has been ended
2013-06-30 12:03:58 -07:00
bmc
5c6e58c017 Remove uv_poll error short-circuit
Fixes #350
2013-06-30 11:39:31 -07:00
brianc
683d636501 better handling of client stream termination
1. Pass an error to an active query if the client is ended while a query is in progress.
2. actually emit 'end' event on the client when the stream ends
3. do not emit an error from native bindings if lasterror is null
2013-03-28 13:24:33 -05:00
brianc
2273f5796f fix native on node v0.9.x - closes #297 2013-03-07 08:17:41 -06:00
Philipp Borgers
320a049b2b add a NODE_MODULE() statement; fixes #222 2013-01-24 12:09:38 +01:00
bmc
020607c49c return false as default/fall-through value 2013-01-22 23:17:10 -06:00
bmc
6da25609cf fix native compile warnings 2013-01-21 15:44:34 -06:00
anton
88d684f925 bugfix. sometimes native copy to loose rows 2013-01-20 19:45:41 -06:00
anton
c5c31143c1 1. behave correctly if copy to/from is send to db by query method (report error in standart way); 2. bugfix and code review in native copy to implementation 2013-01-20 19:45:40 -06:00
anton
8bcd40595d make copy related events to have same names in native and libpq clients 2013-01-06 12:06:26 -06:00
anton
5cb871c143 minimal error handling 2013-01-06 12:06:26 -06:00
anton
c014096e0e COPY TO/FROM native/libpq done. Looks like it works, but need to test 2013-01-06 12:06:26 -06:00
brianc
99f1717ba8 make error message text more obvious 2012-12-10 23:23:23 -06:00
booo
7826e492b4 Change return type of Cancel() to bool.
This should fix the following warning on windows:

..\src\binding.cc(117): warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning)

Spotted in issue #165.
2012-09-26 22:00:24 +02:00
booo
175d18dce7 Fix for issue #165. Use libuv events instead of libev events. 2012-09-26 22:00:24 +02:00
Ben Montgomery
52b1361f67 remove unnecessary whitespace 2012-08-07 08:38:57 -05:00
Ben Montgomery
a9635a3d8d Improve error message accuracy of native SendQuery
* add private method const char *GetLastError() to src/binding.cc
* add var const char *lastErrorMessage to SendQuery in src/binding.cc
* throw result of PQErrorMessage inside SendQuery

This commit replaces the static/vague error message "PQsendQuery
returned error code" with the actual message text of the error.
The method GetLastError() returns the text of PQErrorMessage.
GetLastError is called from within SendQuery to retrieve the message.
2012-08-07 08:38:57 -05:00
booo
5329e5e17e check if the uv_poll_t struct is initialized before calling uv_poll_stop
Before this fix a call to End after an error in Connect() would result in
a segfault.

https://github.com/brianc/node-postgres/issues/136#issuecomment-6774321
2012-07-06 15:16:04 +02:00
booo
3680b5931b remove unnecessary LOG call; we emit a proper error later in the code 2012-07-06 14:25:07 +02:00
booo
60130a933d check for CONNECTION_BAD status before calling PQsetnonblocking 2012-07-06 14:22:59 +02:00
booo
125075b796 call uv_poll_start on Flush() 2012-07-06 14:15:51 +02:00
booo
d7b9f64b02 remove unnecessary comments 2012-07-06 14:08:03 +02:00
booo
70de032e61 initial fix for issue #136
Test case from ticket works but some tests fail.

Signed-off-by: brianc <brian.m.carlson@gmail.com>
2012-07-05 22:38:07 -05:00
brianc
176e6c7ab2 include command metadata with native query result callback - closes #128 2012-05-30 23:38:03 -05:00
Phil Sorber
0b34675449 Flush writes to server after every send. 2012-03-12 21:34:35 -04:00
wink
e0313aeffd if PQconsumeInput returns 0, something broke, throw an error! 2012-03-01 15:13:47 -06:00
Christophe Macabiau
fe6d5aeb68 query cancellation (libpq native binding) 2011-11-02 19:30:44 +01:00
brianc
558cbbb66a fix compiler warning 2011-10-12 10:52:20 -05:00
brianc
b59e0041b3 native bindings compatible with v0.5.x 2011-10-10 22:03:27 -05:00
Homme Zwaagstra
21b597ef17 All errors are now instances of the built in Error class
This is a fix for issue #50. It alters both the native binding and the
javascript binding to ensure that any errors returned by Postgresql
are returned to the client code as instances of the built in Error
class.

The test code has been updated to assert that this is the case. Rather
than run some individual tests the updated test code ensures this is
the case for *all* errors encountered during a test run.
2011-09-22 12:36:12 +01:00
brianc
0ea77f475b fix for gh-issue #26 2011-05-19 20:46:27 -05:00
Brian Carlson
e4ce36bda8 support for 'payload' of notification in postgres >=9.0 2011-04-14 22:53:44 -05:00
Brian Carlson
863a1ba85c inline AbortConnection 2011-04-14 22:42:35 -05:00
Brian Carlson
af8ebe520c AbortError should return void 2011-04-14 22:41:00 -05:00
Brian Carlson
2836c8b64d native connection failures gracefully emit error from libpq 2011-04-14 22:38:55 -05:00
brianc
a2f7ca3939 code cleanup 2011-03-08 20:14:50 -06:00