Giter Club home page Giter Club logo

Comments (23)

jguerin avatar jguerin commented on August 30, 2024

Thanks for filing this, Dragos!

Jay will take a look and see whether there are any breaking changes which would prevent us from moving to node.js 0.8 easily.

from node-sqlserver.

nikg avatar nikg commented on August 30, 2024

What are the timelines to get Node 0.8 compatibility?

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

We are looking at it now, and will know the amount of work required to get it done. Alternatively, please feel free to try to compile the code against 0.8 and let us know if there are any issues. :)

from node-sqlserver.

uiteoi avatar uiteoi commented on August 30, 2024

+1 for this enhancement.

I haven't been able to compile against 0.8.

Have only been able to install with 0.6.19 with the binaries available here: http://www.microsoft.com/en-us/download/details.aspx?id=29995.

Does not work either with version 0.7.12.

from node-sqlserver.

CnApTaK avatar CnApTaK commented on August 30, 2024

i have node,js 0.8.1 x64 and all works fine. so driver is compatible to latest node.js version.

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

Hi CnApTaK,

Did you build the driver from source, or did you load the binary?

Thanks,

Jonathan

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

Here's the results of my investigation into compatibility. It looks like there's no known issues. When we rev to v0.2.0, we will update the driver to work with the latest version of node.js.

I've verified that the develop branch builds against node.js 0.8.1, and also executes:

C:\Users\jguerin\Documents\GitHub\node-sqlserver [develop]> node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected]
gyp info spawn msbuild
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
  stdafx.cpp
  Connection.cpp
  Utility.cpp
  OdbcException.cpp
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
  ResultSet.cpp
  OdbcOperation.cpp
  OdbcConnection.cpp
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
c:\users\jguerin\.node-gyp\0.8.1\src\node_object_wrap.h(57): warning C4251: 'no
de::ObjectWrap::handle_' : class 'v8::Persistent<T>' needs to have dll-interfac
e to be used by clients of class 'node::ObjectWrap' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\jguerin\.node-gyp\0.8.1\src\node_buffer.h(71): warning C4251: 'node::B
uffer::constructor_template' : class 'v8::Persistent<T>' needs to have dll-inte
rface to be used by clients of class 'node::Buffer' [C:\Users\jguerin\Documents
\GitHub\node-sqlserver\build\sqlserver.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\sqlserver
.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(99
0,5): warning MSB8012: TargetPath(C:\Users\jguerin\Documents\GitHub\node-sqlser
ver\build\Release\sqlserver.dll) does not match the Linker's OutputFile propert
y value (C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\Release\sqlserv
er.node). This may cause your project to build incorrectly. To correct this, pl
ease make sure that $(OutDir), $(TargetName) and $(TargetExt) property values m
atch the value specified in %(Link.OutputFile). [C:\Users\jguerin\Documents\Git
Hub\node-sqlserver\build\sqlserver.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(99
1,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile p
roperty value (.node). This may cause your project to build incorrectly. To cor
rect this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) prop
erty values match the value specified in %(Link.OutputFile). [C:\Users\jguerin\
Documents\GitHub\node-sqlserver\build\sqlserver.vcxproj]
     Creating library C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\Re
  lease\sqlserver.lib and object C:\Users\jguerin\Documents\GitHub\node-sqlserv
  er\build\Release\sqlserver.exp
  Generating code
  Finished generating code
  sqlserver.vcxproj -> C:\Users\jguerin\Documents\GitHub\node-sqlserver\build\R
  elease\sqlserver.dll
gyp info ok

Test script:

// Query with streaming
var sql = require('node-sqlserver');
var conn_str = "Driver={SQL Server Native Client 11.0};Server=(local);Database=AdventureWorks2012;Trusted_Connection={Yes}";

var stmt = sql.query(conn_str, "SELECT FirstName, LastName FROM Person.Person ORDER BY LastName OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY");
stmt.on('meta', function (meta) { console.log("We've received the metadata"); });
stmt.on('row', function (idx) { console.log("We've started receiving a row"); });
stmt.on('column', function (idx, data, more) { console.log(idx + ":" + data);});
stmt.on('done', function () { console.log("All done!"); });
stmt.on('error', function (err) { console.log("We had an error :-( " + err); });

Execution:

C:\Users\jguerin\Documents\nodeapp>node server.js
We've received the metadata
We've started receiving a row
0:Syed
1:Abbas
We've started receiving a row
0:Catherine
1:Abel
We've started receiving a row
0:Kim
1:Abercrombie
We've started receiving a row
0:Kim
1:Abercrombie
We've started receiving a row
0:Kim
1:Abercrombie
We've started receiving a row
0:Hazem
1:Abolrous
We've started receiving a row
0:Sam
1:Abolrous
We've started receiving a row
0:Humberto
1:Acevedo
We've started receiving a row
0:Gustavo
1:Achong
We've started receiving a row
0:Pilar
1:Ackerman
All done!

C:\Users\jguerin\Documents\nodeapp>node -v
v0.8.1

from node-sqlserver.

CnApTaK avatar CnApTaK commented on August 30, 2024

I build it from source downloaded yesterday

from node-sqlserver.

uiteoi avatar uiteoi commented on August 30, 2024

It does not work for me on x64 (although it works in x86 mode) with node 0.8.1:

C:\node-sqlserver>node --version
v0.8.1

C:\node-sqlserver>node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected]
gyp info spawn python
gyp info spawn args [ 'C:\Users\Jean.node-gyp\0.8.1\tools\gyp_addon',
gyp info spawn args 'binding.gyp',
gyp info spawn args
'-IC:\node-sqlserver\build\config.g
ypi',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2010' ]
gyp info ok

C:\node-sqlserver>node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected]
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]

[ ... ]

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012:
TargetPath(C:\node-sqlserver\build\Release\sqlserver.dll) does not match the Linker's OutputFile property value
(C:\node-sqlserver\build\Release\sqlserver.node). This may cause your project to build incorrectly. To correct this, please make sure that
$(OutDir), $(TargetName) and $(TargetExt) property values match the value specified
in %(Link.OutputFile). % [C:\node-sqlserver\build\sqlserver.vcxproj ]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker's
OutputFile property value (.node). This may cause your project to build incorrectly. To
correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt)
property values match the value specified in %(Link.OutputFile).
[C:\node-sqlserver\build\sqlserver.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
[C:\node-sqlserver\build\sqlserver.vcxproj]
gyp ERR! build error Error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! build error at ChildProcess.onExit
(C:\Users\Jean\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:215:23)
gyp ERR! build error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! build error at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

Just checking this, but have you installed the x64 compiler?

from node-sqlserver.

jkint avatar jkint commented on August 30, 2024

It seems the error is missing the Kernel32 library? Which x64 compiler are you using? Visual Studio installed compiler(s) or the x64 compiler(s) installed by the Windows 7.1 SDK?

from node-sqlserver.

uiteoi avatar uiteoi commented on August 30, 2024

Thanks ^^, I was indeed using the wrong compiler without knowing.

I had installed both VS Express installed (per the instructions provided in README.md) and Windows 7.1 SDK from a source that I can't recall. But I was compiling from the standard command prompt which apparently was using the VS instead of the SDK.

For people coming from a Unix background, like me, who do not compile under Windows very often, more detailed instructions would therefore be welcome.

Other than that I love the service provided by your driver, it fits perfectly our current needs although in production we would prefer to run the driver from a Linux machine.

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

Great to hear you got it working!

Just to confirm, you got it working with:

  • Windows SDK 7.1 x64 compiler
  • node.js 0.8.1

Is that right? Are you also able to use the driver in your application with no problems?

On the Linux side of things, we do have a Linux ODBC Driver available, so please feel free to have a go at compiling it for your production environment. We haven't tried it yet, but the ODBC driver is 64-bit, and should be API-compatible with the SNAC ODBC driver.

from node-sqlserver.

uiteoi avatar uiteoi commented on August 30, 2024

Yes, this is now working with Windows SDK 7.1 x64 compiler and node.js 0.8.1 x64 on Window 7.

Application-wise, we just started the development a few days ago and it is working fine but we haven't done anything fancy so far.

Thanks for the link to the Linux ODBC driver we're using Ubuntu server but hopefully this should also work.

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

From #29:

Hi!

I am migrationBot

Did you know that path.{exists,existsSync} was moved to fs.{exists,existsSync}, and that tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) in node v0.8.0? Read more @API changes between v0.6 and v0.8

I automatically made some changes I think will help you migrate your codebase to node v0.8.0, please review these changes and merge them if you feel they are useful, If they are not you can ignore this Pull Request.

For backwards compatibility please use something like fs.existsSync || (fs.existsSync = path.existsSync);, fs.exists || (fs.exists = path.exists);, and tty.setRawMode || (tty.setRawMode = process.stdin.setRawMode); respectively.

Have a Nice Day!

--migrationBot

from node-sqlserver.

fineline avatar fineline commented on August 30, 2024

Hi, I cannot get the binary download to work, is it because it is not compatible with 0.8?

module.js:480
process.dlopen(filename, module.exports);
^
Error: The specified procedure could not be found.

is reported, with node-sqlserver\lib\sqljs:20:11 as the source.

I have Native Client 2012 installed. Let me know if the binary downloads should work with 0.8, and I'll file as separate issue.

from node-sqlserver.

uiteoi avatar uiteoi commented on August 30, 2024

Hi fineline,

To work with version 0.8x you need to compile the driver from source as it is not compatible with the binaries.

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

We are working on the next update to the driver, and we will update the binary when we do so. For now, you will have to build from source to get compatibility with Node.js 0.8.x.

Thanks,

Jonathan

from node-sqlserver.

fineline avatar fineline commented on August 30, 2024

Thanks uiteoi, jguerin, I will wait until the project progresses to be compatible with the current node release.

from node-sqlserver.

nikg avatar nikg commented on August 30, 2024

Any updates if 0.8 compat version is out?

from node-sqlserver.

jkint avatar jkint commented on August 30, 2024

The develop branch should compile using node-gyp with Visual C++ 2010 and node 0.8 just fine. Please let us know if this is not your experience.

from node-sqlserver.

yozik04 avatar yozik04 commented on August 30, 2024

master branch also compiles for me. But it is buggy. Use develop for now.

from node-sqlserver.

jguerin avatar jguerin commented on August 30, 2024

Verified working for 0.2.0 release.

from node-sqlserver.

Related Issues (20)

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.