Giter Site home page Giter Site logo

node-teradata's Introduction

node-teradata

GitHub version Downloads Build status

Teradata for Node.js


Features

  • Asynchronous
  • Read/Write
  • Prepared Statements
  • Connection Pool
  • Keep Alive

Installation

npm install node-teradata

Java

node-teradata uses JDBC to communicate with Teradata:

  1. Download and install JDK 8 (1.8.0 u112)
  2. Make sure Java is included in your system path

Other versions of the JDK may work, but they have not been tested

Teradata

A JDBC driver is provided by Teradata for communicating with their databases via Java:

  1. Download the Teradata JDBC Driver (15.10.00.33)
  2. Create a "jars" folder in the root of your app
  3. Extract the archive's contents into the folder:
  • tdgssconfig.jar
  • terajdbc4.jar

Other versions of the Teradata JDBC Driver may work, but they have not been tested

Usage

Include module

var Teradata = require('node-teradata');

Create an instance

var teradata = new Teradata(config);

Example Config

var config = {
  url: 'jdbc:teradata://myserver',
  username: 'MyUsername',
  password: 'MyPassword',
  driver: './jars/',
  minPoolSize: 1,
  maxPoolSize: 100,
  keepalive: {
    interval: 60000,
    query: 'SELECT 1',
    enabled: true
  },
  jvmOptions: ['-Xrs']
};

Examples

Read

var id = 7;
var sql = 'SELECT * FROM MyDatabase.MyTable WHERE Id = ' + id;

return teradata.read(sql)
  .then(function(response) {
    console.log(response);
  });

Write

var id = 7;
var sql = 'DELETE FROM MyDatabase.MyTable WHERE Id = ' + id;

return teradata.write(sql)
  .then(function(count) {
    console.log(count);
  });

Read Prepared Statement

Anonymous Parameters
var id = 7;
var sql = 'SELECT * FROM MyDatabase.MyTable WHERE Id = ?';

return teradata.readPreparedStatement(sql, [
    teradata.createPreparedStatementParam(1, 'Int', Number(id))
  ])
  .then(function(response) {
    console.log(response);
  });
Named Parameters
var id = 7;
var sql = 'SELECT * FROM MyDatabase.MyTable WHERE Id = :id';

return teradata.readPreparedStatement(sql, [
    teradata.createPreparedStatementParam('id', 'Int', Number(id))
  ])
  .then(function(response) {
    console.log(response);
  });

Write Prepared Statement

Anonymous Parameters
var id = 7;
var username = 'Foo';
var sql = 'UPDATE MyDatabase.MyTable SET Username = ? WHERE Id = ?';

return teradata.writePreparedStatement(sql, [
    teradata.createPreparedStatementParam(1, 'String', username),
    teradata.createPreparedStatementParam(2, 'Int', Number(id))
  ])
  .then(function(count) {
    console.log(count);
  });
Named Parameters
var id = 7;
var username = 'Foo';
var sql = 'UPDATE MyDatabase.MyTable SET Username = :username WHERE Id = :id';

return teradata.writePreparedStatement(sql, [
    teradata.createPreparedStatementParam('id', 'Int', Number(id)),
    teradata.createPreparedStatementParam('username', 'String', username)
  ])
  .then(function(count) {
    console.log(count);
  });

See the docs for more information

node-teradata's People

Contributors

dependabot[bot] avatar ericdotdata avatar jasonpierce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-teradata's Issues

Missing named parameter

When an identically named parameter appears multiple times in a query, the error message "Missing named parameter" is thrown.

EXPECTED BEHAVIOR
All instances of an identically named parameter within a query should be successfully parsed without error.

WORKAROUND
Use anonymous parameters

installation error

I have python 3 on my window 10 PC and get following error when running nmp install node-teradata, as below:
`
C:\dev\node>npm install node-teradata

[email protected] install C:\dev\node\node_modules\java
node-gyp rebuild

C:\dev\node\node_modules\java>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\zw803k\AppData\Local\Continuum\anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dev\node\node_modules\java
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\dev\node\package.json'
npm WARN node No description
npm WARN node No repository field.
npm WARN node No README data
npm WARN node No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zw803k\AppData\Roaming\npm-cache_logs\2018-11-29T08_18_44_644Z-debug.log`

this looks like an issue with python3 - in python 3 the print should be print() instead. am I right? and how to fix this? thanks

Failed to install on Windows 10

Anyone installed successfully on windows 10 ?

npm install --arch=ia32 node-Teradata

I got below error

java.obj : error LNK2001: unresolved external symbol __imp__JNI_CreateJavaVM@12 [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bindin gs.vcxproj] C:\Workspace\nodejs\rest\node_modules\java\build\Release\nodejavabridge_bindings.node : fatal error LNK1120: 1 unresolved externals [C:\Workspace\nodej s\rest\node_modules\java\build\nodejavabridge_bindings.vcxproj]


C:\Workspace\nodejs\rest>npm install --arch=ia32 node-teradata
npm WARN deprecated [email protected]: Use uuid module instead

> [email protected] install C:\Workspace\nodejs\rest\node_modules\java
> node-gyp rebuild


C:\Workspace\nodejs\rest\node_modules\java>if not defined npm_config_node_gyp (node "C:\Users\prmadi\AppData\Roaming\nvm\v6.9.1\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  java.cpp
  javaObject.cpp
  javaScope.cpp
  methodCallBaton.cpp
  nodeJavaBridge.cpp
  utils.cpp
  win_delay_load_hook.cc
..\src\javaObject.cpp(116): warning C4996: 'v8::Function::NewInstance': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodej
avabridge_bindings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(3274): note: see declaration of 'v8::Function::NewInstance'
..\src\javaObject.cpp(349): warning C4996: 'v8::Function::NewInstance': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodej
avabridge_bindings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(3274): note: see declaration of 'v8::Function::NewInstance'
..\src\utils.cpp(347): warning C4996: 'v8::Value::ToInt32': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8202): note: see declaration of 'v8::Value::ToInt32'
..\src\utils.cpp(354): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_b
indings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(897): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(927): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(956): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(983): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(1019): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_b
indings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\java.cpp(1044): warning C4996: 'v8::Value::ToNumber': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_b
indings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(8166): note: see declaration of 'v8::Value::ToNumber'
..\src\utils.cpp(969): warning C4996: 'v8::Object::GetHiddenValue': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavab
ridge_bindings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(2956): note: see declaration of 'v8::Object::GetHiddenValue'
..\src\utils.cpp(973): warning C4996: 'v8::Object::SetHiddenValue': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavab
ridge_bindings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(2954): note: see declaration of 'v8::Object::SetHiddenValue'
..\src\utils.cpp(977): warning C4996: 'v8::Object::SetHiddenValue': was declared deprecated [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavab
ridge_bindings.vcxproj]
  C:\Users\prmadi\.node-gyp\6.9.1\include\node\v8.h(2954): note: see declaration of 'v8::Object::SetHiddenValue'
     Creating library C:\Workspace\nodejs\rest\node_modules\java\build\Release\nodejavabridge_bindings.lib and object C:\Workspace\nodejs\rest\node_mod
  ules\java\build\Release\nodejavabridge_bindings.exp
java.obj : error LNK2001: unresolved external symbol __imp__JNI_CreateJavaVM@12 [C:\Workspace\nodejs\rest\node_modules\java\build\nodejavabridge_bindin
gs.vcxproj]
C:\Workspace\nodejs\rest\node_modules\java\build\Release\nodejavabridge_bindings.node : fatal error LNK1120: 1 unresolved externals [C:\Workspace\nodej
s\rest\node_modules\java\build\nodejavabridge_bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\prmadi\AppData\Roaming\nvm\v6.9.1\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\prmadi\\AppData\\Roaming\\nvm\\v6.9.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Workspace\nodejs\rest\node_modules\java
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

Support JDBC "execute"

Presently, node-teradata supports executeQuery via read() and readPreparedStatement(), and executeUpdate via write() and writePreparedStatement(). The JDBC API has a third method for executing statements called execute.

  • executeQuery: executes SELECT statements
  • executeUpdate: executes non-SELECT statements (e.g., INSERT, UPDATE, DELETE)
  • execute: executes SELECT and non-SELECT statements. But, more importantly, it can execute multiple statements, which is something neither of the other methods support

Acceptance Criteria

  1. New method execute executes one or more (read and/or write) statements within the query
  2. New method executePreparedStatement executes one or more (read and/or write) statements within the query, using prepared statements
  3. execute and executePreparedStatement returns an array of results:
    • One result for each statement within the query
    • Results are indexed by order of statement execution
  4. Documentation is updated with examples

Call stored procedure who return clob

Hi,
I would like to call stoted function using teradata, and the result expected is Clob, but i got an empty array depending the function used;
The stored function used:
let sql = CALL DEV.MY_PROC(:data,OUT_RESULT)

return db.readPreparedStatement(sql, [db.createPreparedStatementParam('data', 'String', data)]);

The results is:
{
"success": true,
"data": []
}
More informations:

Nodejs: 10.0.0
NPM: 6.1.0
OS: Ubuntu
Database: Teradata

Upgrade package dependencies

Acceptance Criteria

  1. package.json dependencies contain latest versions
  2. package.json devDependencies contain latest versions

Issue while pushing the Node JS microservice using Teradata to PCF

Getting the java error when trying to push the Node JS code to the PC.
The Node JS Code internally connects to the teradata to pull the table details.

I have added the reference of the package.json and the error which i am getting.

Error----

node-gyp rebuild
[node-java] Error: not found: javac
gyp: Call to 'node findJavaHome.js' returned exit status 1 while in binding.gyp.
while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/tmp/contents574403284/deps/0/node/
lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:160:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:209:12)

Package.json----
{
"name": "first_app",
"version": "1.0.0",
"description": "node app",
"author": "NA",
"contributors": "",
"dependencies": {
"java": "^0.9.0",
"body-parser": "^1.18.2",
"build-tools": "^7.2.4",
"cfenv": "^1.0.4",
"express": "^4.16.2",
"teradata": "^0.1.1"
},
"repository": {},
"main": "server1.js",
"engines": {
"node": "9.5.0"
},
"keywords": []
}

Support Teradata JDBC Driver 16.00.00.32

Presently, node-teradata only supports Teradata JDBC Driver (15.10.00.33). The lib may already work with Teradata JDBC Driver 16.00.00.32, but no testing has been done.

Start with testing all functionality against Teradata JDBC Driver 16.00.00.32. If necessary make changes to the lib to support Teradata JDBC Driver 16.00.00.32. If any breaking changes are necessary, move this ticket to milestone 2.0.0.

Acceptance Criteria

  1. Supports Teradata JDBC Driver (16.00.00.32)
  2. Still works with Teradata JDBC Driver (15.10.00.33)

Use Promise.promisify instead of Promise.promisifyAll

This is an optimization, and is not applicable to all scenarios. This applies to any scenario where only a single async function is being used on the object currently being passed into Promise.promisifyAll.

Acceptance Criteria

  1. Promise.promisify is used when only a single async function is required on an object

Receiving new error: [email protected] install: `node-gyp rebuild` after using node-teradata for years.

I have been using this package for 3+ years and never encountered an issue. Suddenly out of no where it is causing issues. I know it is this package as if I remove it from my package.json everything is fine.

Error below. Any help would be greatly appreciated.

../src/utils.cpp: In function '_jobject* v8ToJava(JNIEnv*, v8::Local<v8::Value>)': ../src/utils.cpp:343:110: error: no matching function for call to 'v8::String::Value::Value(v8::Isolate*, v8::Local<v8::String>)' v8::String::Value val(v8::Isolate::GetCurrent(), arg->ToString(Nan::GetCurrentContext()).ToLocalChecked()); ^ ../src/utils.cpp:343:110: note: candidate is: In file included from ../src/utils.h:6:0, from ../src/utils.cpp:1: /root/.node-gyp/8.6.0/include/node/v8.h:2743:14: note: v8::String::Value::Value(v8::Local<v8::Value>) explicit Value(Local<v8::Value> obj); ^ /root/.node-gyp/8.6.0/include/node/v8.h:2743:14: note: candidate expects 1 argument, 2 provided make: *** [Release/obj.target/nodejavabridge_bindings/src/utils.o] Error 1 make: Leaving directory /usr/src/app/node_modules/java/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/src/app/node_modules/java
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev but none was installed.
npm WARN [email protected] requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev but none was installed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-06-25T22_24_05_661Z-debug.log`

Upgrade eslint to 7.x

The current version of eslint, 5.x, has known vulnerabilities. An upgrade to 7.x would be beneficial from a security standpoint, as well as a general performance enhancement.

However, node-teradata 1.x supports Node 6.x and 7.x, which cannot run eslint 6+. This issue is therefore targeting milestone 2.0, where we will drop support for node 6.x and 7.x

Add support for named parameters in prepared statements

Currently prepared statements use the Teradata syntax of anonymous parameters referenced by index:

var id = 7;
var username = 'Foo';
var sql = 'UPDATE MyDatabase.MyTable SET Username = ? WHERE Id = ?';

return teradata.writePreparedStatement(sql, [
    teradata.createPreparedStatementParam(1, 'String', username),
    teradata.createPreparedStatementParam(2, 'Int', Number(id))
  ]);

This proposed enhancement adds the ability to name parameters (similar to Sequelize's named replacements):

var id = 7;
var username = 'Foo';
var sql = 'UPDATE MyDatabase.MyTable SET Username = :username WHERE Id = :id';

return teradata.writePreparedStatement(sql, [
    teradata.createPreparedStatementParam('username', 'String', username),
    teradata.createPreparedStatementParam('id', 'Int', Number(id))
  ]);

Acceptance Criteria

  1. Valid chars for a named parameter include: letters, numbers, underscore
  2. Named parameters are case sensitive
  3. Named parameters within the sql must be prefixed with :
  4. writePreparedStatement supports named parameters
  5. readPreparedStatement supports named parameters
  6. createPreparedStatementParam accepts a string as it's first parameter (internally placing it in named parameter mode)
  7. An error is not thrown when createPreparedStatementParam cannot find a matching named parameter within the statement
  8. An error is thrown when the params array (of writePreparedStatement and readPreparedStatement) contains named parameters with duplicate names
  9. An error is thrown when the params array (of writePreparedStatement and readPreparedStatement) contains both anonymous and named parameters
  10. Documentation is updated with named parameter examples

Fix Travis CI configuration error

Travis CI is throwing error 'The command "eval yarn " failed' during build.

POSSIBLE SOLUTIONS

  1. Update .travis.yml to use NPM instead of Yarn

Column having data type as Decimal are giving blank object in response JSON

Hi ,

We are facing issue with node-teradata plugin where when we perform read/ readPreparedStatement operation for table having columns of data type "DECIMAL" , the response JSON is giving blank object w,r,t those columns.

For example in table test, if column2 and column3 are of data type "DECIMAL" say DECIMAL(4,2) then
if we execute select * from test the result response is coming as:

[
{
"column1" : 123,
"column2" : {
} // blank object
"column3" : {
} //blank object
"column4" : "abcd"
}
]

Can someone please help resolving this issue or suggest any workaround to get decimal values.

Thanks and Regards,
Rohan

Document API

** Acceptance Criteria **

  1. New file exists at "/docs/api.md"
  2. "/docs/README.md" contains a link to api.md
  3. All methods are documented
  4. All events are documented
  5. All properties are documented

npm install gives MSBUILD : error MSB3428: Could not load the Visual C++ component

I am not sure about what this error is, I am getting this while installing node-teradata package through npm

 C:\Users\SHAIK\Documents\nodeworkspace\nodeTeradataDB> npm install node-teradata

> [email protected] install C:\Users\SHAIK\Documents\nodeworkspace\nodeTeradataDB\node_modules\java
> node-gyp rebuild


C:\Users\SHAIK\Documents\nodeworkspace\nodeTeradataDB\node_modules\java>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microso
ft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [C:\Users\SHAIK\Documents\nodeworksp
ace\nodeTeradataDB\node_modules\java\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\SHAIK\Documents\nodeworkspace\nodeTeradataDB\node_modules\java
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SHAIK\AppData\Roaming\npm-cache\_logs\2018-08-27T15_31_32_868Z-debug.log

Error 3130 - Response limit exceeded

After a connection is opened (not reserved -- opened), the app will throw this error after a short time (maybe 1-2 min).

RCA
Teradata docs state this is due to a ResultSet or Statement not being closed. It appears to be related to the jdbc lib's keepalive feature.

A quick glance at the jdbc lib's code, and it's easy to see it's creating a Statement and a ResultSet which are not being closed.

POSSIBLE SOLUTIONS

  1. Ditch the jdbc keepalive and roll our own, so we can handle cleanup
  2. Look into specifying CLOSE_CURSORS_AT_COMMIT for auto cleanup (which the jdbc lib may be expecting)

WORKAROUND
Disable keepalive: this can be done by excluding keepalive from the config (default is disabled), or by explicitly setting enabled: false in the config

Add 'initialized' Property

Acceptance Criteria

  1. initialized exists on the node-teradata instance
  2. Is a read-only boolean property (not a function)
  3. false by default
  4. true after the node-teradata instance is successfully initialized
  5. Documentation is updated

Notes
We can check this.pool to determine whether or not the instance has been initialized.

Support JDK 9

Presently, node-teradata only supports JDK 8 (1.8.0 u112). The lib may already work with JDK 9, but no testing has been done.

Start with testing all functionality against JDK 9. If necessary make changes to the lib to support JDK 9. If any breaking changes are necessary, move this ticket to milestone 2.0.0.

Acceptance Criteria

  1. Supports JDK 9 (9.0.1)
  2. Still works with JDK 8 (1.8.0 u112)

Move wiki into repo

Acceptance Criteria

  1. Documentation is valid markdown (GitHub flavor)
  2. docs folder exists in app root
  3. docs/README.md is home page with Table of Contents listing pages: Config; Cleanup
  4. docs/cleanup.md contains wiki page: Cleanup
  5. docs/config.md contains wiki page: Config

node-teradata relies on old version of JDBC

node-teradata is using an old version of JDBC that uses an older version of java.
Can we have the version of JDBC updated to 0.7.0 in the dependencies to use the newest version of java (0.12.1) instead of (0.11.1) which has a issues with node-gyp

Use winston for logging

Replace getLogger with winston

Acceptance Criteria

  1. Config object accepts optional logger.level property
  2. logger.level defaults to 'error'
  3. logger.level is passed to winston.level
  4. All instances of log are replaced with winston
  5. var log is removed
  6. getLogger is removed
  7. package.json contains winston requirement
  8. Documentation is updated

Make jvm options configurable

Hi,

I had jvm errors when running queries with this package on my production machine. I fixed those errors by adding an additional jvm option after this line.

It'd be great if you could add the possibility to specify additional jvm options with the configuration object. Is it possible for you ?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.