How to implement insertOrUpdate
jnfJNF opened this issue · comments
jnfJNF commented
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
当我想同步两个数据源的数据时,如何实现根据ID进行新增或插入,即insertOrUpdate。请问有相应的组件吗?如何实现?
Use case
No response
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
github-actions commented
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
When I want to synchronize data from two data sources, how can I add or insert based on ID, that is, insertOrUpdate. Are there any corresponding components? How to achieve?
Use case
No response
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Wenjun Ruan commented
Is this related to ds? There are two ways
- Directly use DB upsert SQL, different databases provide different grammar, some may doesn's support.
- Query the data in the database, if it does not exist then insert, others update. You may need to use lastUpdateTime to do optimistic concurrency control.