Cannot set primary key ID when id type is int or int64 #586
Labels
breaking change
This feature / fix introduces breaking changes
proposal
A suggestion for a change, feature, enhancement, etc
Milestone
Hello,
with a postgres connection (same issue at least with sqlite), if ID field is type int or int64 (
ID int 'db:"id"'
); calling tx.Create with a preset ID is not possible. ID will be overwritten bycreate
method. ( see dialect_postgresql.go#L64 and dialect_postgresql.go#L87 )Is it possible to change and have the same behavior as UUID ?
pop/dialect_common.go
Line 71 in d30b82d
A possible fix, would be to add a check like :
Here is a testcase that can be added to executors_test.go file that illustrate this problem :
And here is the test output:
The text was updated successfully, but these errors were encountered: