Skip to content
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

Skip trying to insert generated fields #323

Open
mikestefanello opened this issue Feb 2, 2022 · 1 comment
Open

Skip trying to insert generated fields #323

mikestefanello opened this issue Feb 2, 2022 · 1 comment

Comments

@mikestefanello
Copy link

Describe the bug
Some of my PG tables have generated fields. Trying to insert records for those models will fail, even if you omit the field because the query will still try to insert nil rather than nothing at all.

To Reproduce
Steps to reproduce the behavior:

  1. Generate a model for a table in PG that has a generated field
  2. Try to insert a model record for that table
  3. The insert will fail, ie pq: cannot insert into column "the_generated_field_name"

Expected behavior
Insert/update queries should automatically exclude any generated fields.

@AlekSi
Copy link
Member

AlekSi commented Feb 2, 2022

Some background on why nil/NULL is being added to the query: #146 (comment)

See also #100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants