-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: Add ent-based sqlite3 storage #1906
Conversation
Thanks @nabokihms ! I briefly reviewed the PR, here are a couple thoughts:
|
|
I don't think we have to exclude generated code, but putting it in separate commits definitely helps. |
67ae6f9
to
1d519ad
Compare
There are three commits now:
|
05adee5
to
a804f54
Compare
@sagikazarmark, thanks for updating dependencies and adding dependabot! The only package that left required an update is the MySQL driver. Should I open PR for it? |
Signed-off-by: m.nabokikh <[email protected]>
Signed-off-by: m.nabokikh <[email protected]>
Signed-off-by: m.nabokikh <[email protected]>
@sagikazarmark I bumped ent version to 0.8.0, resolved conflicts, added support for recently merged settings for refresh tokens. Dependencies changes look good now. |
Signed-off-by: m.nabokikh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@nabokihms Feel free to merge it if you think it's ready. |
🎉 |
Happy to see this PR! 🥳 Please, feel free to tag me on GitHub or ping me in ent Slack channel if you need any support for Ent. |
Thanks @a8m ! We are still experimenting with ent here, but I followed the project for quite some time now and it's amazing (by far the best Go ORM). One thing that's going to be a concern is migrations (not very familiar with how ent does that yet) in a production environment. |
We're working now on a new migration platform for ent that will cover 99% of the cases. I'll be happy to get your feedback or just to hear your thoughts before we're OSS-ing it. Thanks 🙏 |
When it comes to migration, I'm always worried about automated migrations:
Therefore when working for large systems, I always insisted on having a separate, manual process available for migrations. Not just that, but it was also mandated that these changes must be backward compatible between two subsequent versions. For example: if you wanted to delete a column from the database, first you needed to remove any code using that column (version 1) and in the next release (or rather before deploying it) you were allowed to add a migration step that removed that column. I think there is no good solution available for these issues, especially in the Kubernetes/Cloud Native world (where Dex is mostly used). That being said, we also use automatic migrations in Dex, because it's just easier. But I'd love to see a solution where we can give operators the means to manually run migrations prior to deploying a new version or at least see some tooling that can help with recovering from a bad state. @a8m These are my thoughts about migration. Hope it helps a bit. |
Overview
This PR adds an ability to switch to experimental ent-based sqlite3 storage
What this PR does / why we need it
Related #1864
There is the first part of the SQL layer refactoring. What this PR does:
Special notes for your reviewer
Following the "one step at a time" ideology, it looks like a good idea to split the refactoring into chunks.
This part has no negative impact and shows the most vital benefits of switching to using ORM.
I will add a full roadmap to the issue mentioned above.
Does this PR introduce a user-facing change?
Users can switch to utilizing the new driver. Unfortunately, there is no doc, neither migration to switch from using sqlite3 driver to sqlite3-ent. It will be implemented in future PRs.