-
Notifications
You must be signed in to change notification settings - Fork 162
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
Support for composite primary keys #160
base: master
Are you sure you want to change the base?
Conversation
Would it be better to keep the current methods for if there is only one column of primary key. Also why have you only changed the delete methods to accept multiple primary keys a and missed out the get methods? |
I'll gladly fix if I missed anything, could you point to exact methods? Delete was the only one with changed signature as there is an overload which allows deleting based on the primary key. But maybe it would be worthwhile to keep the old one too, so if someone is using only single attribute keys they can keep using the old Delete call, without creating a dictionary every time. Creating the table should behave the same if there's a single attribute key, allowing for autoincrement to be set. Maybe I also should have left the name "PK" instead of changing it to "PKs" as technically there's always only one primary key (even if it spans over multiple columns). |
There are two "Find" methods that you would need to change also a "Get" method all on SQLiteConnection |
…ds without changing the method signature
Good point. I changed those 2 methods, and also Delete method to take object again as parameter to not break any calls with only a single column primary key. |
Also TableMapping is at the moment part of the publicAPI, so it may not be a good idea to remove a property like you have, maybe it would be better to provide both properties and have PK throw an exception if there is a composite primary key so that current users of the library can still use the Property if they are not using composite primary keys. |
You mean, have both PK and PKs? Hmm. |
Yeah that would probably be better than breaking the code of people who are using the library. |
Yeah, both options are kind of bad, but breaking change is probably worse. :) |
I pushed the changes we discussed. |
This sounds nice, I'll review/merge when I've got the current prerelease/beta out the door. |
…into feature-composite-primary-keys
Any news on this? |
I'm sorry but I don't have any time to spend on this project at the moment. |
Any word on this? Just ran into a situation where Composite Keys would be really nice to have :) |
It's already done here with latests paracleum updates: https://github.com/softlion/SQLite.Net-PCL It breaks the Delete(primary key), as it conflicts with the Delete(object) and with Delete(primary keys[]). |
Can we get an update? Would love to have this. softlion, do you have your nuget for your fork? I couldn't find it. |
Yes i have a private nuget server on internet. PM me your email and i grant you access. |
Is this supported now? |
Any news with this?? |
Any news with this?? Is working in Xamarin Ios? |
Code changes to enable composite primary keys.
It was mentioned here. #72
I think it would be really good to have this supported. I was only able to run tests under Generic, Win32 and WindowsPhone8, others wouldn't build for some reason, I'll have to investigate.
Let me know what you think!
EDIT: I see AppVeyor build failed for some reason, but I don't think it's because of my code.