Closed boggye closed 8 months ago
TIL i learned - I had never heard about it before. I gave it a quick shot and implemented it.
If the identity column is always generated it now won't appear in the unsaved row types, while if it's generated by default it'll behave like column with default
Thank you for the prompt fix!
Hi,
TLDR; Unless I am missing some settings, Typo is not aware of identity auto generated fields.
I use anorm and I have the following table:
As you can see the values in the
school_id
field are autogenerated sequentially. The GENERATED ALWAYS indicates the field is always populated by the database. This is reflected in the data returned by the information_schema.columns table as well.select * from information_schema.columns c where c.table_name = 'school'
The insert method code generated by Typo is:
When I execute:
I get this exception:
Imo, Typo should generate code that doesn't insert into autogenerated fields. The
insert(SchoolRowUnaved)
fails as well.There is also the variant:
This allows both ways, i.e. server generated sequence or manually provided value.
Thanks