Error when setting up an sqlite repo

16:20:02.947 [info] == Running 20251101005337 Compliance.Repo.Migrations.InitializeExtensions1.up/0 forward

16:20:02.951 [info] execute "CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)\nAS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$\nLANGUAGE SQL\nSET search_path = ''\nIMMUTABLE;\n"
** (Exqlite.Error) near "OR": syntax error
CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)
AS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$
LANGUAGE SQL
SET search_path = ''
IMMUTABLE;
16:20:02.947 [info] == Running 20251101005337 Compliance.Repo.Migrations.InitializeExtensions1.up/0 forward

16:20:02.951 [info] execute "CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)\nAS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$\nLANGUAGE SQL\nSET search_path = ''\nIMMUTABLE;\n"
** (Exqlite.Error) near "OR": syntax error
CREATE OR REPLACE FUNCTION ash_elixir_or(left BOOLEAN, in right ANYCOMPATIBLE, out f1 ANYCOMPATIBLE)
AS $$ SELECT COALESCE(NULLIF($1, FALSE), $2) $$
LANGUAGE SQL
SET search_path = ''
IMMUTABLE;
I picked the Ash tag because there is no tag for AshSqlite.
6 Replies
Gonzalo Muñoz
What does your installed_extensions section look like? Is this for a new project? It looks like it's trying to set up a SQLite DB with Postgres features Honestly looks like an AshSQLite bug. I encountered something similar a couple of days back. I had to manually edit my migrations because it was trying to drop a column or something like that, that couldn't be done with SQLite
rtorresware
rtorreswareOP2w ago
I don't have any generated migrations yet though, which is the weird part. I did start the project with psql and then move to sqlite
Gonzalo Muñoz
Yeah that's probably it then. Search your project for installed_extensions or any other remnants of a Postgres setup
rtorresware
rtorreswareOP2w ago
So is it supported to have multiple repos? One SQLite one Postgres etc
ZachDaniel
ZachDaniel2w ago
@rtorresware you likely have a migration for that from when you started with Postgres yeah if you're doing both you should use separate repos
rtorresware
rtorreswareOP2w ago
Yes I probably did not cleanup very well. Also hope you’re feeling better Zach!

Did you find this page helpful?