-
Notifications
You must be signed in to change notification settings - Fork 101
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
Dapper.Contrib cannot handle GUID primary keys & SqlMapperExtensions.Insert<T> has wrong usage int & long #5
Comments
@SwissMaWi , You are right it indeed has a limitation. Could you please format the code? @mgravell or @SamSaffron , your thoughts? |
My proposition is to separate insertion of single rows and lists. |
@SwissMaWi , Do you mean something like I had to use DapperExtensions because it allows Fluent mapping in separate class as opposed to Attributes decorated on top of entities. |
This was my reason for not using this lib and creating my own. Check out dapper.database https://github.com/dallasbeek/Dapper.Database |
@dallasbeek let's improve dapper... this is sustainable. |
Just tried to implement something with minimal changes, however it is not possible since if you do not use DB autoincrement INT keys, the pattern of primary key creation is entirely different. I think we have to separate the concern of auto incrementing PK from the concern of PK type first, before this can be implemented. No matter how, it will cause major changes in the INSERT workflow I believe. Regarding GUID keys: should the application create them or should Dapper offer to "autocreate" them?`I would need some opinions here... |
@SwissMaWi , EF Core has sequential GUID generator https://github.com/dotnet/efcore/blob/main/src/EFCore/ValueGeneration/SequentialGuidValueGenerator.cs Also EF Core has a method or attribute for ValueGeneratedNever |
@maulik-modi so in your opinion generating GUID keys should be the concern of Dapper.Contrib? |
|
SqlMapperExtensions.Insert will fail when numeric db keys reach the Int32 limit (yes, this happens on high traffic dbs) and also fails completely since it assumes primary keys are integers. If primary keys are not integers (i.e. GUIDs or something else) the library fails completely.
Is there any interest for an improvement? I have some proposition in mind.
The text was updated successfully, but these errors were encountered: