Skip to content
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

Add support for custom delete statements #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cervengoc
Copy link

Added an extension point to allow customizing generated delete statements. This might be used for adding conditions, etc.
This can open some solution paths for #122 and #126 as well.

@cervengoc
Copy link
Author

@jbogard Please point me to the right direction, is this technically enough, or should I for example

  • Add tests for all database providers?
  • Add some documentation somewhere?

Thank you

@jbogard
Copy link
Owner

jbogard commented May 20, 2024

Interesting idea, seems useful!

@cervengoc
Copy link
Author

cervengoc commented Jun 3, 2024

@jbogard sorry for pinging you.

In the meantime I've examined that these kind of customizations are already possible via implementing a custom IDbAdapter and passing that in with the config. A simple implementation could be for example by decorating an existing provider and modifying the generated SQL text line by line. However, that's definitely a bit harder, but taking the rarity of the use-cases into account, it still might be enough so I probably would rather abandon this PR. What do you think? On the other hand, is IDbAdapter ment to be part of the public API of this tool, or is it ment to be internal? Because if the latter, than it might not be adviced to use it like that.

@alesdvorakcz
Copy link

alesdvorakcz commented Jul 11, 2024

I like this idea, it would be helpful for me. Decorating an IDbAdapter does not work for me because it is internal class.

My use case: I have some data added to a table by EF migration and I want to keep them so I dont need to run migrations again

EDIT: My mistake, I found out how to decorate IDbAdapter, I can access its instance from static class DbAdapter. Its still not really user friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants