Skip to content

Request: Insert* methods should return the PK regardless of if the PK was generated by the DB or not #1027

@grofit

Description

@grofit

Currently when you call InsertAsync (for example) and the PK is non identity column (i.e UUID with default) or a PK is already provided by the entity you are inserting, the Insert method returns an empty PK value.

This change would make it so you are ALWAYS provided the PK of the entity from the Insert even if you provided it yourself or the DB generated it outside of an identity situation, this provides a more consistent experience for the library consumer. It may also be worth noting that the PK is only returned if it is an identity field run on the DB.

This was discussed in a gitter conversation with @mikependon and he was happy for it to be raised here as a request.

Metadata

Metadata

Assignees

Labels

breaking-changesA breaking changes (issue, request, enhancement, etc)enhancementNew feature or requestfixedThe bug, issue, incident has been fixed.requestA request from the community.todoThings to be done in the future

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions