elixir-sqlite/ecto_sqlite3

Problem with Ecto >= 3.13 and `literal/1`

Closed this issue · 3 comments

Unknown Error

     * ** (Exqlite.Error) near "(": syntax error
     INSERT INTO "posts" AS p0 ("id","type","title","decimal","uniq_one","uniq_two","created_at","updated_at") VALUES (?1,?2,?3,?4,?5,?6,?7,?8) ON CONFLICT ("uniq_one", "uniq_two") WHERE (type = 'sponsored') DO UPDATE SET "title" = EXCLUDED.identifier('title'), "updated_at" = COALESCE(EXCLUDED.identifier('updated_at'), ?) RETURNING "author_id","organization_id","updated_at","created_at","uniq_custom_two","uniq_custom_one","uniq_two","uniq_one","stuff","status_enum","status_enum","status","decimal","price","type","category","public","score","title","id"

Ecto changed from sending {:literal, ...} to sending {:identifier, ...} in the latest release, which this adapter doesn't handle. I think this constitutes a breaking change on Ecto's part, not sure if it should be "fixed" here or not, but I'm putting this here in case others are searching.

Oh fun.

👋 @warmwaffles

I can PR a fix similar to plausible/ecto_ch#231 and maybe also restrict the supported Ecto versions to ~> 3.13.0 to avoid these problems in the future.

Go for it and add the restrictions.