SL-Pirate / dart_odbc

A Dart package for interacting with ODBC databases. It allows you to connect to ODBC data sources and execute SQL queries directly from your Dart applications.
MIT License
5 stars 2 forks source link

macOS Oracle connect error: Exited (-9) #5

Closed treestae closed 2 months ago

treestae commented 2 months ago
final oracle = DartOdbc('/usr/local/lib/instantclient_23_3/libsqora.dylib.23.1');

It exited with error code -9.

I followed the Oracle ODBC setup instructions from this link.

The connection works fine when I test it with isql OracleODBC-23 id pw.

I tried postgreSQL below code.

final postgreSQL = DartOdbc('/opt/homebrew/Cellar/psqlodbc/16.00.0005/lib/psqlodbcw.so');

It works great.

Could you tell me how to properly set up Oracle ODBC for macOS?

SL-Pirate commented 2 months ago

I have not tested nor am able to test your configuration because I do not own a mac so helping you in this case would be a lot tricky but I will try my best. Since you have tested the connection with isql the driver seems to be working. In that case please provide me the full error output from dart_odbc library. I will try to make some sense out of it. Thank you for reaching out with this issue. Hope I we can find a solution to this issue. 😊

treestae commented 2 months ago

@SL-Pirate

After testing step by step, I found that the problem was occurring at:

DynamicLibrary.open('/usr/local/lib/instantclient_23_3/libsqora.dylib.23.1');

The only error message was Exited. (-9).

So I removed all the drivers and set them up again in the HOME directory, and it loaded without any issues.

If there's any additional work I did, it was creating a symbolic link with the following command: ln -s /opt/homebrew/Cellar/unixodbc/2.3.12/lib/libodbcinst.2.dylib /Users/$USER/instantclient_23_3/libodbcinst.2.dylib

Now it's working well on m2 macOS.

Thank you for your willingness to help!

SL-Pirate commented 2 months ago

You are welcome. Glad your issue was fixed! Closing as completed