Conditional insert or replace -> with StorIO better?
See original GitHub issueI have following procedure:
- execute sql-statement:
select to_update from test where uuid='123-XYZ'
(to_update
is 0 or 1; orno-select-data
) - if result of
1.
is1
orno-select-result
then I have to execute another sql (example):insert or update (...) values (...)
I’m wondering if this could be done with StorIO in an elegant way…
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
SQLite conditional insert or replace - Stack Overflow
I'm trying to insert or update a record into a sqlite database, and only update the value if the new value is greater...
Read more >Concurrency with Select-conditional Insert/Update/Delete
Clients compute new intervals for one variable and store them in that table. To preserve consistency (for a variable_id I don't want intervals ......
Read more >Video: Intermediate conditional formatting - Microsoft Support
Training: Apply conditional formatting to specific cells, tables, ... and use formulas as the basis of a conditional formatting rule. ... Want more...
Read more >Conditional text in document header - Microsoft Community
Hi I am doing a collection of notes for the finals, where I would like to present the heading 2 in the header....
Read more >REPLACE - SingleStore Documentation
It is recommended to use the INSERT ON DUPLICATE KEY UPDATE statement instead of REPLACE , because it allows you to use more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Rainer-Lang I guess, custom put resolver - it is only way to do it inside StorIO (@artem-zinnatullin, @karlicoss correct me if I’m wrong).
From my point of view it’s preferably to make such decision on a higher level (some domain model that represents business logic). Imagine if you will have to check not just
test
table to find out if value up to date. But also obtain some information from shared preferences or smth else. It will be improperly to wrap all these logic in StorIO. And in these cases you’ll have to completely rewrite your put resolver.I found a workaround, so I don’t need this. Anyway, @nikitin-da thanks for your effort.