[Cuis-dev] ODBC error

Jon Raiford raiford at labware.com
Sun Oct 20 07:48:50 PDT 2024


I think people in the open source world just become good problem solvers and fix things for themselves. In this case, is it correct for Cuis to add homebrew libs by default on the Mac?  I’m not so sure. Maybe if it was installed via homebrew then it should be added, but the reason Apple added this restriction was specifically to prevent bad actors from adding compromised libraries and fiddling with the path in order to compromise applications. Technically things are more secure like this.

Anyway, for your issue, just edit the RunCuisOnMacTerminal.sh script and add something like this at the beginning:

export DYLD_LIBRARY_PATH="$(brew --prefix)/lib:${DYLD_LIBRARY_PATH}"

Jon

From: Mark Volkmann <r.mark.volkmann at gmail.com>
Date: Sunday, October 20, 2024 at 7:32 AM
To: Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
Cc: Jon Raiford <raiford at labware.com>
Subject: Re: [Cuis-dev] ODBC error
I should have asked “Is it possible that nobody that uses Cuis Smalltalk in macOS accesses relational databases?”

---
R. Mark Volkmann
Object Computing, Inc.


On Oct 20, 2024, at 6:26 AM, Mark Volkmann <r.mark.volkmann at gmail.com> wrote:
Yikes! Sounds complicated. Can you point me to any documentation that describes how I could reference a lib path in the Open Smalltalk VM?

Is it possible that nobody that uses Cuis Smalltalk accesses relational databases?

---
R. Mark Volkmann
Object Computing, Inc.


On Oct 19, 2024, at 9:46 PM, Jon Raiford via Cuis-dev <cuis-dev at lists.cuis.st> wrote:

I assume you are on a Mac. You are running into Apple “courage“ like when they removed headphone jacks. They stop applications from using library paths that weren’t explicitly allowed when the application was compiled. In the old days you could add to the library path in your bash profile but the only way to make it work now is to add to the library path in a launch script. One potential option is to explicitly reference the homebrew lib paths in the Open Smalltalk vm and recompile it, assuming you installed the drivers using homebrew.

Jon
________________________________
From: Cuis-dev <cuis-dev-bounces at lists.cuis.st> on behalf of Mark Volkmann via Cuis-dev <cuis-dev at lists.cuis.st>
Sent: Saturday, October 19, 2024 7:20:15 PM
To: Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
Cc: Mark Volkmann <r.mark.volkmann at gmail.com>
Subject: [Cuis-dev] ODBC error

I really want to learn how to access relational databases like SQLite and Postgres from Cuis Smalltalk so I can do that as part of an HTTP endpoint implemented using the WebClient package. I have the Cuis ODBC package installed and have registered a DSN for my database which is "TodoDSN". I tested it by entering `isql TodoDSN` which supposedly verifies that it can be accessed using ODBC. That works great. I can enter "select * from todos;" and I see the records I expect. Then I tried this in a Workspace:

 conn := ODBCConnection dsn: dsn user: user password: password.

That gives "Error: External module not found" which comes from this code in the class ODBCLibrary:

sqlAllocEnv: environmentHandle
    "SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle);"
    <cdecl: int16 'SQLAllocEnv' (SQLHENV*)>
    ^ self externalCallFailed

Can anyone explain what this is doing and what "module" it is looking for?

--
R. Mark Volkmann
Object Computing, Inc.
--
Cuis-dev mailing list
Cuis-dev at lists.cuis.st
https://lists.cuis.st/mailman/listinfo/cuis-dev<https://lists.cuis.st/mailman/listinfo/cuis-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241020/1f59fd6f/attachment.htm>


More information about the Cuis-dev mailing list