Add "replace" to update queries, just like in SQL
See original GitHub issueUse case: Update several entries, where I need to replace a certain string value. There is no need to select the items.
Current solution: Select all desired entries and update one by one. This is a performance nightmare.
Feature description: When updating an entry, use the following syntax (works in “normal” SQL):
UPDATE myTable set someValue=REPLACE(someValue, 'old text', 'new text') WHERE someID='71AD3D9C-7755-474D-BA78-B23AF9968030'
Would be great if this would work with crate as well.
Additional info: Should also be made available for updating arrays, where one could remove or add an item to the array(s if multiple entries), without actually fetching them.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Using REPLACE in an UPDATE statement - SQLTeam.com
The REPLACE function is easy to use and very handy with an UPDATE statment. ... is to use this in conjuntion with a...
Read more >UPDATE and REPLACE part of a string - Stack Overflow
If the column to replace is type text or ntext you need to cast it to nvarchar. UPDATE dbo.xxx SET Value = REPLACE(CAST(Value...
Read more >How to UPDATE from a SELECT statement in SQL Server
The conditional update statement is used to change the data that satisfies the WHERE condition. 1. 2. 3. UPDATE table.
Read more >What is Replace in SQL and How to Use Replace() Function
Replace in SQL is a built-in function. Learn how to use Replace() function in SQL with the UPDATE statement and much more in...
Read more >Search and Replace String in Database - SQL Tutorial
Sometimes, you want to search and replace a substring with a new one in a column e.g., change a dead link to a...
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
We’ve merged a
replace
scalar with https://github.com/crate/crate/pull/7924, it will be available with 3.2@hnstbndr Sorry for this, it seems this happened in error. We will reopen this, of course @mfussenegger also notified me about that.