Re:Hctree is an experimental high-concurrency database back ...
by hot_gril on Wednesday January 18, 2023 @09:17PM
(#34435950)
I haven't done this, but I'd want it. I'd like to write my code to use a Postgres database, except swap in something similar to a SQLite database instead when I'm either testing or not yet at scale. SQLite does everything in just a library linked with your code, unlike Postgres which is a separate running server. I can't simply use SQLite for this because its API is different from Postgres's.
Re:Hctree is an experimental high-concurrency database back ...
by nick__m on Wednesday January 18, 2023 @11:08PM
(#34436595)
You should read on the ancient tech called ODBC.
Re:Hctree is an experimental high-concurrency database back ...
by hot_gril on Thursday January 19, 2023 @12:15AM
(#34436957)
I almost said ODBC too but wasn't sure if I fully understood it.
Re:Hctree is an experimental high-concurrency database back ...
by nl on Thursday January 19, 2023 @01:29AM
(#34437337)
Doesn't almost every language have some kind of abstraction layer that allows this?
JDBC/ODBC/DB-API/Sequelize ORM (ignoring the ORM part).
This used to be one of the major use cases for SQLite - running automated tests and being able to throw away the database file (or manage it at different points in the tests).
Re:Hctree is an experimental high-concurrency database back ...
by deredede on Thursday January 19, 2023 @03:30AM
(#34438016)
ODBC doesn't help you if you use any sort of pgsql-specific extension, however.
Re:Hctree is an experimental high-concurrency database back ...
by hot_gril on Thursday January 19, 2023 @12:35PM
(#34443058)
Yeah, but the abstraction layers get in the way if/when I need to optimize queries or use special features, plus it's easier to just write SQL. I'd rather target a specific DBMS and rewrite my queries if I ever change it.
> ignoring the ORM part
As it should be :)
Re:Hctree is an experimental high-concurrency database back ...
by nl on Thursday January 19, 2023 @05:08PM
(#34446360)
No, all (?) these things let you pass raw SQL straight to the database.
In the case of JDBC and ODBC (and I think DB-API) thats all they do.
Re:Hctree is an experimental high-concurrency database back ...
by hot_gril on Thursday January 19, 2023 @05:36PM
(#34446651)
But raw SQL made for Postgres doesn't necessarily work for SQLite and vice versa. That's what I mean by the SQL standard being thrown out the window. You might be able to write SQL that works in both if you're careful and avoid a lot of features.
Can you expand on this? How did you package postgres as a lib?