I must admit your lib is faster than mine here is code https://gist.github.com/2854642
here is ab results node-firebird-libfbclient: Concurrency Level: 5 Time taken for tests: 3.346934 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 885000 bytes HTML transferred: 821000 bytes Requests per second: 298.78 [#/sec] (mean) Time per request: 16.735 [ms] (mean) Time per request: 3.347 [ms] (mean, across all concurrent requests) Transfer rate: 258.15 [Kbytes/sec] received node-firebird: Concurrency Level: 5 Time taken for tests: 2.928723 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 885000 bytes HTML transferred: 821000 bytes Requests per second: 341.45 [#/sec] (mean) Time per request: 14.644 [ms] (mean) Time per request: 2.929 [ms] (mean, across all concurrent requests) Transfer rate: 295.01 [Kbytes/sec] received 2012/6/1 Denys Khanzhiyev <xden...@gmail.com> > > > 2012/6/1 Henri Gourvest <hgourv...@gmail.com> > >> Le 01/06/12 16:23, Denys Khanzhiyev a écrit : >> >>> Thanks. A bit tricky. >>> >> how would you do it more simply ? >> everything is async! > > > It is not obvious what and where is going on. Here is my proposal, while > it is a bit tricky too :-) > Have not tested if it works actually > > function() { > var tr, st; > function error(err) { > if (tr) tr.rollback(); > if (st) st.drop(); > console.log(err); > } > > > function fetchByOne(onData,onEnd,error) > { > database.startTransaction(function(transaction) { > tr = transaction; > tr.newStatement("select * from rdb$relations", function(statement) > { > st = statement; > st.execute(tr, function() { > > (function cb(fetched) { > if (fetched) { > st.drop(); > tr.commit(); // fetch finished > onEnd(); > } else { > st.fetch(tr, function(ret) { > onData(ret.data); // fetch is going on > cb(ret.fetched); > }, error) > } > })(false); > > }, error) > }, error); > }, error) > } > > fetchByOne(function(data){ > console.log(data); > }, > function(){ > console.log(finished); > },error); > > >> >> >> And how not to fetch blobs? Blobs are better to >> >>> stream. >>> >> >> if you do not give a transaction to the fetch method, blobs are not >> fetched. >> >> >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-** >> Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines> >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nodejs@googlegroups.com >> To unsubscribe from this group, send email to >> nodejs+unsubscribe@**googlegroups.com<nodejs%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en> >> > > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en