We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Invalid SQL query is generated when inserting into a table that has default values for all columns.
e.g.
When inserting into below table
CREATE TABLE topics ( id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY, );
with this rust code
let topic = topics::ActiveModel { ..Default::default() }; topic.insert(db).await?;
returns this error DbErr(Query("error returned from database: syntax error at or near \")\""))
DbErr(Query("error returned from database: syntax error at or near \")\""))
because below query is generated INSERT INTO "topics" () VALUES () RETURNING "id"
INSERT INTO "topics" () VALUES () RETURNING "id"
The text was updated successfully, but these errors were encountered:
Hey @Crypto-Virus, welcome and thanks for the report!
For insert statement without specifying columns & values it should generate
INSERT INTO "topics" DEFAULT VALUES RETURNING "id"
Sorry, something went wrong.
ActiveModel
NotSet
billy1624
Successfully merging a pull request may close this issue.
Invalid SQL query is generated when inserting into a table that has default values for all columns.
e.g.
When inserting into below table
with this rust code
returns this error
DbErr(Query("error returned from database: syntax error at or near \")\""))
because below query is generated
INSERT INTO "topics" () VALUES () RETURNING "id"
The text was updated successfully, but these errors were encountered: