-
Notifications
You must be signed in to change notification settings - Fork 283
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 update&replace api #131
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
==========================================
+ Coverage 40.56% 42.10% +1.54%
==========================================
Files 22 22
Lines 2894 2978 +84
==========================================
+ Hits 1174 1254 +80
- Misses 1720 1724 +4 ☔ View full report in Codecov by Sentry. |
另外没啥没看到测试,pr介绍也没有。 |
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
include/mysql.hpp
Outdated
if (condition && type == OptType::update) { | ||
iguana::for_each(t, [&t, ¶m_binds, this](auto item, auto i) { | ||
if (is_conflict_key<T>( | ||
"`" + std::string(iguana::get_name<T>(i).data()) + "`")) { |
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.
不要用连加,效率低。
|
||
template <typename T, typename... Args> | ||
int insert_impl(OptType type, const std::vector<T> &v, bool get_insert_id, | ||
Args &&...args) { |
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.
args是多余的吗,没看到哪里有用到?
@@ -463,9 +486,38 @@ class sqlite { | |||
} | |||
|
|||
template <typename T, typename... Args> | |||
int insert_impl(bool update, const T &t, bool get_insert_id = false, | |||
int insert_impl(OptType type, const T &t, bool get_insert_id, | |||
Args &&...args) { |
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.
args没用到?
} | ||
|
||
template <typename T, typename... Args> | ||
int insert_impl(OptType type, const std::vector<T> &v, bool get_insert_id, |
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.
args没用到
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.
评论看不到?
No description provided.