sagiegurari / simple-oracledb

Extend capabilities of oracledb with simplified API for quicker development.
Apache License 2.0
36 stars 4 forks source link

Examples #17

Closed wahmedswl closed 7 years ago

wahmedswl commented 7 years ago

Problem Description

Hi, it would be great to have Promise based examples. Currently, i have looked but not able to find any example which is utilizing Promises. Official driver do have examples

Code Example

oracledb.getConnection({
  user: "user",
  password: "password",
  connectString: "tns"
}).then(function (connection) {
  return connection.execute(
    "SELECT USER FROM DUAL"
  ).then(function (result) {
    console.log(result.metaData);
    console.log(result.rows);
    return connection.close();
  }).catch(function (err) {
    console.log(err.message);
    return connection.close();
  });
}).catch(function (err) {
  console.error(err.message);
});

Thanks

sagiegurari commented 7 years ago

ya, I can add some.

wahmedswl commented 7 years ago

Thanks :-)

sagiegurari commented 7 years ago

added more examples for many of the apis (not all). hope it clears things up.

wahmedswl commented 7 years ago

Thanks