Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ Then, on the next page you need to download two packages
- Instant Client Package - SQL*Plus

Then unpack both archives content together into one dir.
Then create subdirs /network/admin and put there your tnsnames.ors file.
Windows users should then add this dir to PATH system variable
Then create subdirs /network/admin and put there your tnsnames.ora file.
Windows users might have to set
- PATH to the folder with sqlplus executable
- ORACLE_HOME to your Oracle folder
- TNS_ADMIN to the folder containing tnsnames.ora file

\* - i.e. Windows users have to install MS Visual Studio in order to get oracledb work

Expand All @@ -26,5 +29,7 @@ sqlplus(sql, connProps, function(err, rows){
else {
console.log(rows)
}
});
},
false, // optional parameter: debug=false (default) activates debug messages on console
5000); // optional parameter: timeout=10000 (default) for sqlplus process in milliseconds
```
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const spawn = require('child_process').spawn
const csvparse = require('csv-parse')
const csvparse = require('csv-parse').parse
const isWin = process.platform === 'win32'
const isMac = process.platform === 'darwin'
const isLinux = process.platform === 'linux'
Expand Down Expand Up @@ -96,6 +96,7 @@ module.exports = function (sql, connProps, callback, bDebug, maxTimeout) {
const colNamesArray = output.split(/\r\n?|\n/, 2)[1].split('"').join('').split(',')
const csvparseOpt = {
columns: colNamesArray,
relax_column_count: true,
skip_lines_with_empty_values: true,
from: 2 // first line is blank, second is headings
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"author": "mankey-ru",
"license": "ISC",
"dependencies": {
"csv-parse": "~1.2.0",
"fix-path": "^2.1.0",
"tmp": "~0.1.0"
"csv-parse": "~5.0.4",
"fix-path": "^4.0.0",
"tmp": "~0.2.1"
}
}