oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

dbconfig.js contains connectString shall be replaced by connectionString #1521

Closed jifbrodeur closed 1 year ago

jifbrodeur commented 1 year ago
  1. What is the link to the documentation section that needs improving? https://github.com/oracle/node-oracledb/blob/main/examples/dbconfig.js

  2. Describe the confusion In the dbconfig.js file the connect string attribute of the object is named: connectString but if called from connect.js this will lead to the following error: Error: ORA-12162: TNS:net service name is incorrectly specified. Renaming the attribute to: connectionString will resolve the issue.

  3. Suggest changes that would help Renaming the attribute to: connectionString will resolve the issue.

cjbj commented 1 year ago

Do you mean https://github.com/oracle/node-oracledb/blob/main/examples/connect.js doesn't run for you? It works fine for me without any change. Can you triple-check whether you had a typo somewhere? Typos are easy to make, and hard to spot!

$ node connect.js
Connection was successful!

The attribute connectString has been in node-oracledb since day 1. It was back in node-oracledb 2.1 that we added an alias connectionString for the same thing. I could understand why connectionString might not work for older versions of node-oracledb, but connectString should always work in any version.

jifbrodeur commented 1 year ago

Hi, sorry for the issue, when you named the oracledb version and their support for connectString and connectionString, it lite up a light bulb. In my npm dependencies I had both node-oracledb and oracledb and in my loading of the oracledb I selected node-oracledb the older version, everything works now and I understand my mistake.

cjbj commented 1 year ago

@jifbrodeur No problems at all.