-
Notifications
You must be signed in to change notification settings - Fork 115
[Feature Request] - Simplify top-level APIs for SqlClient #939
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
Comments
My vote is for not remove all these methods from |
I think manually setting the save mode is helpful for a deeper understanding of Jimmer and the database, and I support redesigning and simplifying the top-level API of SQL Client. And there are some patterns that are actually rarely used and should never be included in top-level APIs. If considering the needs of some users who really do not want to delete these insert/update files, it is recommended to rename them, for example, to pureInset, and not place them at the top level of SQL Client. |
I think it's only necessary to keep one save method, and two overloaded save methods for specifying SaveMode and AssociatedSaveMode, everything else can be removed. And the insert and update methods changed AssociatedSaveMode in version 0.9.0, which was a breaking change that caused many older projects to shy away from upgrading at all. The original insert and update methods, whose AssociatedSaveMode is Replace, have been in use for almost 2 years before version 0.9.0, and the number of these old projects during this 2-year period is very large, and the demands of these old projects should not be ignored! And the simplified Top-Level Api is also more friendly to new users, and the Api will be more unified. |
If possible, I think you can independently maintain this part by yourselves. I believe your team has the ability to do so |
The main point is that AssociatedSaveMode should not follow the change of shortcut API, AssociatedSaveMode should be Replace by default, if you want to change AssociatedSaveMode, you can just set it by your own initiative. For example, the AssociatedSaveMode of insert was originally Replace, but after version 0.9.0, the AssociatedSaveMode of insert was changed to APPEND, and others such as the AssociatedSaveMode of update was changed to APPEND_IF_ABSENT, the AssociatedSaveMode of merge was changed to APPEND_IF_ABSENT, and the AssociatedSaveMode of merge was changed to APPEND_IF_ABSENT. ABSENT, and the AssociatedSaveMode of merge has been changed to MERGE, and so on. The existence of these shortcut APIs changes the default AssociatedSaveMode mode, which is a very inconsistent experience for newcomers, and the need to memorize more APIs has also become more, which seriously undermines the development experience of Jimmer users. |
Reason
Now SqlClient's top-level API is too much, especially for different save modes, provides a very large number of APIs, such as: insert, update, insertIfAbsent, etc. (these APIs also have their own overloaded version), which leads to SqlClient's top-level API is very confusing. In fact, all of these APIs can be accomplished by specifying different parameters in the save method, so it is inappropriate to put these APIs in the top level of SqlClient.
And in version 0.9.0, the insert and update of the associated object save mode of destructive changes , resulting in previous users need to be very careful to upgrade to modify the code is very much , and the current number of top-level API is also a very large number of new users just started learning Jimmer, resulting in difficulties in understanding and improve the cost of learning .
Translated with DeepL.com (free version)
Description
It is recommended that SqlClient's top-level API be redesigned and simplified. Ideally, for all types of save processing, we would like to keep only save and not insert and update, especially insertIfAbsent and so on, which are very seldom used and should never be put into the top-level API.
Currently, there are 6 overloads for the save method alone, which is enough to cope with all kinds of scenarios, and the other simplified APIs are not necessary to be put on the top level, so it is recommended to remove these APIs.
If you really do not want to delete these insert/update, then it is recommended to rename it, for example, to pureInset, and do not put it on the top level of the SqlClient.
Existing solutions
No response
The text was updated successfully, but these errors were encountered: