-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert query not working #1104
Comments
Please provide reproducible example using scastie. The information that you provided is insufficient. |
Sure! I made a scastie like you asked. We can see in the scastie that the query gets parsed as a dynamic query |
@gbogard Query is dynamic because you have specify the type of quotation, please remove that and it will be compile static, see http://getquill.io/#quotation-compile-time-quotations for more information. @gbogard To resolve your issue please remove explicit type in quote and insertMeta as in https://scastie.scala-lang.org/9CUJtp1WSi6kNWL5cUTgtA |
Opened issue to add compiler error when explicit type of insertMeta is set #1105 |
Version: 2.4.2
Module: quill-jdbc
Database: postgres
Expected behavior
I'm trying to insert a new row into a table. My code looks like this
Actual behavior
I'm noticing two issues :
First of all, this code gets compiled as a "Dynamic query", but I don't see why it couldn't be compile as a static quotation. I've used similar code in other places in the project and some of them get compiled as static quotations
Second of all, and most importantly, when actually running the code, the insert query is wrong. Here's what I get :
Here we can see that instead of placing the acual values in the
VALUES
part of the query, quill repeats the column names, resulting in a postgres errorI have no idea why it does that for this particular case class and not all of them
How to reproduce
See the scastie
@getquill/maintainers
The text was updated successfully, but these errors were encountered: