Giter Club home page Giter Club logo

node-odbc's People

Contributors

bbigras avatar bnoordhuis avatar bzuillsmith avatar dfbaskin avatar gurzgri avatar lee-houghton avatar mortenhoustonludvigsen avatar platformamoja avatar rafeememon avatar ratanakvlun avatar rossipedia avatar sannis avatar santigimeno avatar theduderog avatar w1nk avatar wankdanker avatar xylem avatar yorickvp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

node-odbc's Issues

Problems compiling library

Hi,
im having problems compiling the library. I'm investigating it but I can not fix it.

This is the output:

2195 warn [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself. 2196 verbose stack Error: @ratanakvlun/[email protected] install:node-pre-gyp install --fallback-to-build2196 verbose stack Exit status 1 2196 verbose stack at EventEmitter.<anonymous> (/Users/xxx/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 2196 verbose stack at emitTwo (events.js:126:13) 2196 verbose stack at EventEmitter.emit (events.js:214:7) 2196 verbose stack at ChildProcess.<anonymous> (/Users/xxx/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 2196 verbose stack at emitTwo (events.js:126:13) 2196 verbose stack at ChildProcess.emit (events.js:214:7) 2196 verbose stack at maybeClose (internal/child_process.js:925:16) 2196 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 2197 verbose pkgid @ratanakvlun/[email protected] 2198 verbose cwd /private/tmp/sequelize-odbc-mssql 2199 verbose Darwin 18.2.0 2200 verbose argv "/Users/xxx/.nvm/versions/node/v8.11.3/bin/node" "/Users/xxx/.nvm/versions/node/v8.11.3/bin/npm" "install" "--verbose" 2201 verbose node v8.11.3 2202 verbose npm v6.4.1 2203 error code ELIFECYCLE 2204 error errno 1 2205 error @ratanakvlun/[email protected] install:node-pre-gyp install --fallback-to-build2205 error Exit status 1 2206 error Failed at the @ratanakvlun/[email protected] install script. 2206 error This is probably not a problem with npm. There is likely additional logging output above. 2207 verbose exit [ 1, true ]

error: use of undeclared identifier 'boolean'

Hi,

Thanks again for improving this lib !

I can't compile from source on OSX. Search for error in the log below:

gyp info spawn args [ '/Users/kwent/Projects/node-odbc2/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kwent/Projects/node-odbc2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kwent/Projects/node-odbc2/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kwent/.node-gyp/8.4.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/kwent/.node-gyp/8.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/kwent/Projects/node-odbc2/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/kwent/.node-gyp/8.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/kwent/Projects/node-odbc2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/bindings/src/odbc.o
../src/odbc.cpp:215:79: warning: 'NewInstance' is deprecated
      [-Wdeprecated-declarations]
    Local<Value> js_result = Nan::New<Function>(ODBCConnection::constructor)->NewIn...
                                                                              ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:3787:3: note: 'NewInstance' has been
      explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8config.h:332:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/odbc.cpp:262:78: warning: 'NewInstance' is deprecated
      [-Wdeprecated-declarations]
  Local<Object> js_result = Nan::New<Function>(ODBCConnection::constructor)->NewI...
                                                                             ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:3787:3: note: 'NewInstance' has been
      explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8config.h:332:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/odbc.cpp:306:29: warning: implicit conversion of NULL constant to 'int'
      [-Wnull-conversion]
    memset(columns[i].name, NULL, sizeof(SQLWCHAR));
    ~~~~~~                  ^~~~
                            0
../src/odbc.cpp:332:33: warning: implicit conversion of NULL constant to 'int'
      [-Wnull-conversion]
    memset(columns[i].typeName, NULL, sizeof(SQLWCHAR));
    ~~~~~~                      ^~~~
                                0
../src/odbc.cpp:893:9: error: unknown type name 'boolean'; did you mean 'Boolean'?
        boolean* v = (boolean*)malloc(sizeof(boolean));
        ^~~~~~~
        Boolean
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:2345:17: note: 'Boolean' declared here
class V8_EXPORT Boolean : public Primitive {
                ^
../src/odbc.cpp:893:23: error: use of undeclared identifier 'boolean'
        boolean* v = (boolean*)malloc(sizeof(boolean));
                      ^
../src/odbc.cpp:893:31: error: expected expression
        boolean* v = (boolean*)malloc(sizeof(boolean));
                              ^
../src/odbc.cpp:894:12: error: no viable overloaded '='
        *v = value->BooleanValue();
        ~~ ^ ~~~~~~~~~~~~~~~~~~~~~
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:2345:17: note: candidate function (the
      implicit copy assignment operator) not viable: no known conversion from 'bool' to
      'const v8::Boolean' for 1st argument
class V8_EXPORT Boolean : public Primitive {
                ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:2345:17: note: candidate function (the
      implicit move assignment operator) not viable: no known conversion from 'bool' to
      'v8::Boolean' for 1st argument
../src/odbc.cpp:897:41: error: unknown type name 'boolean'; did you mean 'Boolean'?
        params[i].BufferLength = sizeof(boolean);
                                        ^~~~~~~
                                        Boolean
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:2345:17: note: 'Boolean' declared here
class V8_EXPORT Boolean : public Primitive {
                ^
../src/odbc.cpp:1218:19: warning: 'SetPrototype' is deprecated
      [-Wdeprecated-declarations]
        objError->SetPrototype(Exception::Error(Nan::New((uint16_t *)errorMessa...
                  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:3212:3: note: 'SetPrototype' has been
      explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8config.h:332:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/odbc.cpp:1249:15: warning: 'SetPrototype' is deprecated
      [-Wdeprecated-declarations]
    objError->SetPrototype(Exception::Error(Nan::New(message).ToLocalChecked()));
              ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:3212:3: note: 'SetPrototype' has been
      explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8config.h:332:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/odbc.cpp:1265:13: warning: 'SetPrototype' is deprecated
      [-Wdeprecated-declarations]
  objError->SetPrototype(Exception::Error(Nan::New<String>(message).ToLocalChecked()));
            ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8.h:3212:3: note: 'SetPrototype' has been
      explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
  ^
/Users/kwent/.node-gyp/8.4.0/include/node/v8config.h:332:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
7 warnings and 5 errors generated.
make: *** [Release/obj.target/bindings/src/odbc.o] Error 1

Thoughts ?

Regards

Needs proper error handling

  • Format errors returned by ODBC API
  • Propogate errors back to callback context
  • Pass errors to Node.js using callback
  • All public calls should have error handling

decoding problem of unicode

Some colunms of the the result set are array buffers when the type of it is varchar(n) . I try to convert it with iconv-lite and I found that the chinese charactars are converted correctly with utf16 decoding but the english charactars are mistaken under utf16. When decoding with utf8, the english charactars are correct but the chinese ones are mistaken. Is it possible to obtain string directly from your query api?

decoding problems

Hi!

i have some issues when using this. The returned values will have crypted chars like this:

 "AF_TAF_Zieエє⺧䵳": null,
 "AF_Wec눨ѕ㝯䤩漧謀LONGVA뇠ѕ㜐䤩

Any idea?

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.