unixODBC with custom driver

I’m currently trying to connect to an ODBC datasource with a database driver that was compiled for CentOS. The same driver is also working on Ubuntu, so I assume that it should also work on NixOS.

In reality the driver will not even start claiming “No such file or directory”, even though the driver file is obviously present.

Also, I read that this type of error is common, when shared libraries are missing. For me this makes sense, since there are no standard Unix paths in NixOS. So: Is it possible that I’d have to provide an environment for the LD_LIBRARY_PATH? How would I go about to do this?

Can you link to the driver (or are there licensing issues?)

No problem: It’s ftp://ftp.intersystems.com/pub/cache/odbc/2014/cache.2014.1.3.ODBC-lnxrhx64.tar.gz for the proprietary database InterSystems Caché, hence I figured that it might be not super helpful to link it :slight_smile:

I did try to hack something up. Couldn’t really test it because of lack of DB.

This one I would put into your projects repository:

It should respect the environment variable ODBCINI.

If you want to add it globally to your configuration.nix, you can put the above into an overlay and then use the following:

environment.unixODBCDrivers = with pkgs; [ unixODBC-cache ];

That look super promising.
Thank you SO MUCH for your time. I’ll try it right away :slight_smile:

It is working :heart:

I just had to make some minor adjustments:

  1. export ODBCINI=${ODBCINI} needed to be export ODBCINI=${ODBCINI}/odbc.ini
  2. libcacheodbcuw.so needed to be libcacheodbc35.so

Other than that, I just added the recommended settings from InterSystems into the new odbc.ini and it worked flawlessly :tada:

Great to hear you could make it work!

1 Like