ODBC Lassi Kortela (11 Sep 2019 18:44 UTC)
Re: ODBC Duy Nguyen (12 Sep 2019 07:57 UTC)
Re: ODBC Peter Bex (12 Sep 2019 08:35 UTC)
ODBC, DBI and other generic database interfaces Lassi Kortela (12 Sep 2019 09:32 UTC)
DBI and transactions Lassi Kortela (12 Sep 2019 09:37 UTC)
Re: DBI and transactions Duy Nguyen (12 Sep 2019 09:40 UTC)
Re: DBI and transactions Peter Bex (12 Sep 2019 10:00 UTC)
Finishing nailing the coffin shut on ODBC? hga@xxxxxx (13 Sep 2019 15:17 UTC)
Re: Finishing nailing the coffin shut on ODBC? Lassi Kortela (13 Sep 2019 15:31 UTC)
Re: ODBC hga@xxxxxx (12 Sep 2019 11:52 UTC)
(missing)
Re: What databases should get first class support (for what SRFIs and systems)? Peter (14 Sep 2019 17:41 UTC)

Re: What databases should get first class support (for what SRFIs and systems)? Peter 14 Sep 2019 17:41 UTC

Just for reference, I have implementations of the following for Chez and
MIT, based on the ffi:

(query connection sql)
(query connection sql column-names?)

(query* connection sql values)
(query* connection sql values column-names?)

for SQLite (libsqlite3), postgres (libpq), mysql (mysqlclient) and
Oracle (ocilib). Depending on the database, they do a bit of automatic
conversion to the relevant Scheme types. They all work ok. The biggest
problem is Oracle, as you need to register to actually get the driver
files from the website.

They return a list of rows, each row is a list of values. if
column-names? is true, the first "row" contains the column names.

From my experience, it is definitely necessary to have a way to send
direct SQL to the different databases, even if there is a common
abstraction API over them, as the dialects differ too widely (e.g.
Oracle does not support LIMIT, only WHERE ROWNUM > n, Oracle handles the
empty string as NULL, ...).

I have some very basic s-expression->sql code, however as SQL is very
inconsistent, I don't really use it much, but find it much easier to
just directly write SQL strings.

I have a separate ORM mapper on top (only targetting SQLite, because it
was written before the other wrappers), but for me it is often necessary
to directly access table data.

I agree that at least SQLite, postgres and mysql should be targetted,
but the commercial ones are useful to have too (I need to connect to our
Oracle cluster almost every day, and am happy to be able to do it from
Scheme).

Greetings, Peter