When doing ctx.run(liftQuery(values).foreach(v => valueSchema.insert(v))) with a collection that is empty, the following SQL is generated: INSERT INTO table (a, b, c, ...) VALUES. The trailing VALUES is not parseable by postgres + sqlite (and probably others).
Expected behavior
Should be able to insert an empty collection of values (it should probably be a noop on the dynamic batcher level).
Steps to reproduce the behavior
Modify BatchUpdateValuesSpec to have an empty list for val dataBase: List[ContactBase] = Nil
Workaround
Check whether collection is empty before calling insert.
Version:
4.8.3
Module:quill-jdbc
Database:postgres
Actual behavior
When doing
ctx.run(liftQuery(values).foreach(v => valueSchema.insert(v)))
with a collection that is empty, the following SQL is generated:INSERT INTO table (a, b, c, ...) VALUES
. The trailingVALUES
is not parseable by postgres + sqlite (and probably others).Expected behavior
Should be able to insert an empty collection of values (it should probably be a noop on the dynamic batcher level).
Steps to reproduce the behavior
Modify
BatchUpdateValuesSpec
to have an empty list forval dataBase: List[ContactBase] = Nil
Workaround
Check whether collection is empty before calling insert.
@getquill/maintainers