Commit Graph

114 Commits

Author SHA1 Message Date
bmc
56a5903a02 Make throws in query error callback not break client
If you receive an error while running a query and in user's callback
they throw an exception it can disrupt the internal query queue
and prevent a client from ever cleaning up properly
2013-04-19 09:25:53 -05:00
bmc
9b1c4facc2 Make query callback exceptions not break client
If you throw an exception in a query callback the client will not pulse
its internal query queue and therefor will never process any
more queries or emit its own 'drain' event.

I don't find this to be an issue in production code since I restart
the process on exceptions, but it can break tests and cause things
to 'hang'.  My crude benchmarks show no noticable impact in perf
from the try/catch/rethrow.

:q
2013-04-19 09:09:28 -05:00
Karl Mikkelsen
44e4586e18 var utils declared and not used 2013-04-05 17:46:23 +12:00
bmc
766b4286d5 merge branch v1.0 2013-04-04 11:51:55 -05: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
1d6541724e remove deprecation warnings & deprecate lib 2013-03-17 14:51:57 -05:00
brianc
e93a4a5d66 remove pauseDrain/resumeDrain 2013-03-07 16:12:09 -06:00
brianc
213518648b ability to hide deprecation warnings 2013-03-07 10:01:14 -06:00
brianc
6415450634 deprecate pauseDrain/resumeDrain & auto-releasing client pool 2013-03-07 09:47:04 -06:00
brianc
c57eee8661 normalize whitespace, add comments, and do a little house cleaning 2013-03-06 10:26:40 -06:00
brianc
b58ae9e7f7 clean up prototype shorthand
For some reason a few years ago I thought it would be neat to use a shorthand version of prototype to save myself some keystrokes.  That was a cosmetic mistake.  It also breaks ctags.

Also, normalized some whitespace.
2013-03-06 08:48:52 -06:00
Philipp Borgers
a7e9072ab8 fix jshint errors in lib/client.js 2013-01-24 22:05:35 +01:00
Philipp Borgers
4e5e75dbee fix jshint errors for lib/client.js 2013-01-24 22:01:52 +01:00
bmc
1e3107aa55 use ConnectionParameters for js client properties 2013-01-21 16:14:19 -06:00
anton
8ea2f259ed bugfix: correctly create new connection for canceling copy to query 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
c014096e0e COPY TO/FROM native/libpq done. Looks like it works, but need to test 2013-01-06 12:06:26 -06:00
Stephen Sugden
903e9b25ea Attach Query constructors to Client constructors 2012-12-16 00:58:30 -06:00
brianc
1c43930ba1 cleanup & fix failing tests to allow for green merge of pull #228 2012-12-10 22:44:58 -06:00
Troy Kruthoff
e62eb9339b make Query a public api 2012-12-10 21:32:20 -06:00
bmc
9341efe669 allow options to pass to js ssl connection bindings 2012-09-10 21:40:41 -05:00
Bruno Harbulot
158562f3d1 Initial support for SSL/TLS connections. 2012-08-20 21:41:56 -05:00
Brian Bickerton
fc3b34d42f Use 'self.activeQuery' insead of 'this.activeQuery' in the readyForQueue event listener. 2012-05-08 10:07:43 -04:00
Kenny Meyer
a25ef7cae4 Fix indentation 2012-03-22 17:32:56 -03:00
Alexander Sulfrian
f8962fd036 connection can be binary by default
if connection is created with config.binary = true, all queries get
executed with binary result unless explicit disabled with binary = false
2011-11-22 04:53:38 +01:00
Alexander Sulfrian
5d8c8bbcdc fix recognition of query format for empty queries in dictionary format
queries like {text: ""} did not get recognized correctly before and
get converted to {text: {text: ""}}
2011-11-22 04:53:38 +01:00
Christophe Macabiau
f3c8b972fe query cancellation 2011-11-02 16:07:14 +01:00
brianc
06585d6e2c require 'util' instead of 'sys' 2011-10-10 19:40:52 -05:00
booo
5f7e85162a lib/client: added optional callback function to client.prototype.connect(); issue #52 2011-10-03 03:26:49 -05:00
brianc
ec1c70c4b5 ability to pause/resume drain event for long-running async transactions 2011-08-29 23:43:36 -05:00
brianc
cc77a67745 remove double init of variable 2011-06-02 07:24:42 -05:00
brianc
c1b5fe2ab0 native 'notify' and 'notification' events 2011-03-04 20:04:59 +00:00
brianc
bbe704b8db merged master 2011-03-04 19:32:54 +00:00
brianc
1cd1721f7f integration notification tests 2011-03-04 19:30:19 +00:00
brianc
749531f597 notification message 2011-03-03 23:20:47 -06:00
brianc
13a5803aac Merge branch 'master' into libpq 2011-03-03 22:45:00 -06:00
brianc
ec158770f5 client emits notify message from connection 2011-03-03 22:44:31 -06:00
brianc
5459773b90 properly emit notice messages on client 2011-03-03 23:30:17 +00:00
brianc
0b97f699c5 merge master into topic 2011-03-03 18:31:20 +00:00
brianc
7f5f554503 js client emits 'connect' event 2011-03-03 18:07:22 +00:00
bmc
c0ef5296c6 support for connecting via domain socket 2011-03-01 20:35:14 +00:00
brianc
039c394cb1 make pulseQueryQueue explicitly private 2011-02-04 20:07:59 -06:00
brianc
4724444e3d move parseConnectionString utility function into utils 2011-02-04 20:06:52 -06:00
brianc
5496f3199e remove net.Stream references from client 2011-02-04 20:05:02 -06:00
brianc
0732ee215f readability refactoring 2011-02-04 20:03:41 -06:00
brianc
84e452e221 style cleanup 2011-02-04 19:45:30 -06:00
brianc
a5fce8eb7b query events for prepared statements are handled by client 2011-02-04 19:30:30 -06:00
brianc
99093b34c8 query events handled by client in simple query scenario 2011-02-04 19:15:57 -06:00
brianc
daa370a610 move some query listener delegation to client 2011-02-04 19:03:23 -06:00
brianc
cb647935bb slight readability refactor 2011-02-04 18:51:23 -06:00