Closed lucasmartinez closed 8 years ago
wasn't planning to since I prefer async lib, but I can do that since I see many wanted it for orabledb. so guess in around a day or 2 I'll publish something.
Great job. Your library helped me a lot. I would like to use Promise in all my server functions to standarize the way my product is developed having Promise in front aplication and in my backend too. This way the code in front and backend are the same.
All done and published (version 0.1.95) Please check on your end that it works good.
version 0.1.97 now also automatically promisify any extension on top simple-oracledb, for example oracledb-upsert
Bravo. Great Job.
One more question. Is there any way to log all executed querys ? Now I have a custom function to show in the console the execute query or PL/SQL block. But I would like to activate some DEBUG flag globally to show or hide the executed query by any function.
I can add it. should be very simple. will do it probably tomorrow using the debug flag https://github.com/sagiegurari/simple-oracledb/#debug
Great. I suggest to add some debug level to show the sentence ( one debug level ) and bind values ( another debug level ). maybe some extra values like connected user, date, hour, etc.
if you are now running with the NODE_DEBUG flag, all SQLs that go through the connection.execute (that means also all extended connection operations such as query/insert/batchXXX etc...) will be printed with bind params. However, it does not cover the connection.queryStream function found in the oracledb connection object since I don't use it in simple-oracledb (although funny thing is that I wrote it for oracledb via pull request). Hope it solves your issue. If there are problems with that debug printing, please open a new issue.
Problem Description
query method is not returning a Promise.
Code Example
var simpleOracledb = require('simple-oracledb'), oracledb = require('oracledb');
simpleOracledb.extend(oracledb);
oracledb.createPool({ user: 'user', password: 'password', connectString: "127.0.0.1/orcl" }).then(function (dbpool) { dbpool.getConnection().then(function (conection) { conection.query('select sysdate from dual').then(function(r){ console.log(r); }) }); });
Error Stack/Info (if any)
/home/oracle/hermes/node_modules/simple-oracledb/lib/rows-reader.js:49 callback(error, jsRows); ^
TypeError: callback is not a function at onAyncDone (/home/oracle/hermes/node_modules/simple-oracledb/lib/rows-reader.js:49:13) at /home/oracle/hermes/node_modules/async/dist/async.js:3679:13 at /home/oracle/hermes/node_modules/async/dist/async.js:952:25 at iteratorCallback (/home/oracle/hermes/node_modules/async/dist/async.js:997:17) at /home/oracle/hermes/node_modules/async/dist/async.js:847:20 at /home/oracle/hermes/node_modules/async/dist/async.js:3676:17 at /home/oracle/hermes/node_modules/async/dist/async.js:339:31 at onRowRead (/home/oracle/hermes/node_modules/simple-oracledb/lib/rows-reader.js:42:25) at onAyncDone (/home/oracle/hermes/node_modules/simple-oracledb/lib/record-reader.js:117:9) at /home/oracle/hermes/node_modules/async/dist/async.js:3679:13