-->

How do I connect Haskell HDBC to an oracle db on o

2019-06-08 14:57发布

问题:

I was wondering how you are supposed to connect to an oracle db on mac with Haskell HDBC.

I tried doing it through ODBC, by running brew install unixobcd and then installing oracle instant client basic and obdc into a directory. Then in Haskell, with HDBC and HDBC-odbc both installed, calling connectODBC with Driver set to the location of libsqora.dylib.12.1 in said directory.

It is giving me sot-dba: SqlError {seState = "[\"01000\"]", seNativeError = -1, seErrorMsg = "connectODBC/sqlDriverConnect: [\"0: [unixODBC][Driver Manager]Can't open lib '<valid absolute path to libsqora.dylib.12.1>' : file not found\"]"}, but when I cat that location it spills out the appropriate unreadably binary, so its definitely a valid file location.

I was wondering if anyone could either help debug my issue, or just give me instructions on how to set it up from scratch and I will happily do it over properly. I just have no idea where to go from here since it is claiming a file doesn't exist that does, and I am having trouble finding many results on google on how to debug that.

One thing perhaps worth noting is that I ran ./odbc_update_ini.sh /usr/local/Cellar/unixodbc/2.3.4 to set up the oracle odbc driver, because that is the location that brew put unixodbc, was that perhaps incorrect?

If necessary I could consider a different library than HDBC, but I would strongly prefer not having to, it seems like some other libraries such as persistent actually use hdbc/hdbc-odbc under the covers anyway, so surely this shouldn't be hard.