Git Product home page Git Product logo

Comments (3)

TimelordUK avatar TimelordUK commented on June 27, 2024

hello

these should be contained in ms dev include header file

make: Leaving directory '/home/me/dev/js/sql/v8/node_modules/msnodesqlv8/build'
gyp info ok
me@DESKTOP-LCTQPPK:~/dev/js/sql/v8/node_modules/msnodesqlv8$ grep SQLDATETIMEOFFSETN /opt/microsoft/msodbcsql18/include/*.h
#define SQLDATETIMEOFFSETN                  0x2b
me@DESKTOP-LCTQPPK:~/dev/js/sql/v8/node_modules/msnodesqlv8$
me@DESKTOP-LCTQPPK:~/dev/js/sql/v8/node_modules/msnodesqlv8$ ls -alrt /opt/microsoft/msodbcsql18/include/*.h
-rw-r--r-- 1 root root 44040 Jan  3  2023 /opt/microsoft/msodbcsql18/include/msodbcsql.h

which on Ubuntu is alongside the library

me@DESKTOP-LCTQPPK:~/dev/js/sql/v8/node_modules/msnodesqlv8$ ls -l /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1
-rwxr-xr-x 1 root root 2084624 Jan  3  2023 /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1

you may get an idea by looking at one of supplied Docker image files - you likely will also need the odbc dev package

sudo apt-get install -y unixodbc-dev

the locations of where to look are in binding.gyp

it is likely you need to add the location of header files in this file as this is not a supported distribution

see Red Hat section here

https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16&tabs=redhat18-install%2Calpine17-install%2Cdebian8-install%2Credhat7-13-install%2Crhel7-offline

have all equialent steps been taken as below on your install

sudo su

#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version

#RHEL 7 and Oracle Linux 7
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo

#RHEL 8 and Oracle Linux 8
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo

#RHEL 9
curl https://packages.microsoft.com/config/rhel/9.0/prod.repo > /etc/yum.repos.d/mssql-release.repo

exit
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y yum install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo yum install -y unixODBC-devel
Previous versions

near top of build node-gyp should print the found header filed such as below

 ACTION binding_gyp_sqlserverv8_target_print_variables src/BeginTranOperation.cpp
cflags_cpp -std=c++17 | arch: x86_64 | link_path: -L/usr/local/lib -L/usr/local/ssl/lib64/ -L/home/linuxbrew/.linuxbrew/lib/ -L/usr/lib -L. | msodbc_include_folders /opt/microsoft/msodbcsql18/include/ /home/linuxbrew/.linuxbrew/include/ /opt/microsoft/msodbcsql17/include/ /home/linuxbrew/.linuxbrew/include/ 

these are the found locations you will need the required path to include above to show up here for build to work

note I personally have not ever built the driver on this platform - you may be unlucky even after this and the code fails due to compiler compatibility.

from node-sqlserver-v8.

vrnhgd avatar vrnhgd commented on June 27, 2024

ah. I'm using libmsodbcsql-17.5.so.2.1 and none of those are defined in the header msodbcsql.

do you think it's in unixodbc-dev as well?

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on June 27, 2024

I did build a docker image for cento7 which may help as a reference - this does work with driver. I ran into problems with the cpp runtime and eventually pulled gcc 11.2 from src, built that and then built latest node 16 with that compiler before building openssl from src so everything was consistent (else we crash with classic double free SEGV)

this image would likely take hrs to build depending on machine CPU speed but it does produce as we see below a working environment.

apprunner@00ee9bd9dcb4 msnodesqlv8]$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[apprunner@00ee9bd9dcb4 msnodesqlv8]$ gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[apprunner@00ee9bd9dcb4 msnodesqlv8]$ node --version
v16.20.1
[apprunner@00ee9bd9dcb4 msnodesqlv8]$ node samples/javascript/streaming.js
run with Driver={ODBC Driver 18 for SQL Server}; Server=DESKTOP-VIUCH90;UID=linux; PWD=linux; Database=node;Encrypt=no;
submitted select top 5 * from master..syscolumns elapsed 4 ms
meta = [
    {
        "size": 128,
        "name": "name",
        "nullable": true,
        "type": "text",
        "sqlType": "nvarchar"
    },
    {
        "size": 10,
        "name": "id",
        "nullable": false,
        "type": "number",
        "sqlType": "int"
    },

from node-sqlserver-v8.

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.