2026-08-30 14:20 UTC
If I want to support both SQLite and Postgres, do I have to resort to having two parallel sets of scripts basically?
Is there a way, inside a .sql script, to determine which database backend I’m running and branch to at least keep the parts that differ in the same file?
#LazyWeb #SQL #SQLite #Postgres
Replies (1)
-
@peterrenshaw@ioc.exchange 2026-09-01 04:01
@c0dec0dec0de@hachyderm.io You could at install. What happens as you edit the schema? There will be ways to determine a DB type at execution (PL/Python) for postgres; And via sqlite Now you have to work with three languages. Two controlling SQL choice. A simpler alternative: A make file with a TARGET?