odbc ~master

Wrapper for ODBC headers


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

ODBC for D

DUB Package CI

For many years odbc has been available in phobos under etc.c.odbc due to the work of David L. Davis in 2006.

  • etc/c/odbc/sql.d
  • etc/c/odbc/sqlext.d
  • etc/c/odbc/sqltypes.d
  • etc/c/odbc/sqlucode.d

Those modules are now deprecated (see Mark etc.c.odbc as deprecated), and the functionality being moved to core.sys.windows. As this will cause issues in packages that need to use ODBC from non-windows environments I created this package to simply move the code as it was prior to the change, so that it can simply be used as a dub package. The imports are now:

  • odbc/sql.d
  • odbc/sqlext.d
  • odbc/sqltypes.d
  • odbc/sqlucode.d

Installing a driver

You'll need to have an ODBC driver installed. For example to use SQL Server you can use msodbcsql17, msodbcsql18 or FreeTDS.

Windows

On Windows you can use chocolatey to install the SQL Server ODBC driver:

choco install sqlserver-odbcdriver

Linux

To install Microsoft's ODBC Driver (either 17 or 18), you can install the msodbcsql17 or msodbcsql18 package.

Ubuntu
sudo curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

sudo ACCEPT_EULA=Y apt-get install msodbcsql17 -y
Authors:
  • Samael Bate (singingbush)
  • David L. Davis (original author)
Dependencies:
none
System dependencies:
ODBC needs to be available (odbc32.dll on Windows)
Versions:
1.0.0 2021-Jun-10
~master 2022-Mar-02
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 4 downloads this week

  • 47 downloads this month

  • 984 downloads total

Score:
0.9
Short URL:
odbc.dub.pm