New feature: Search + replace on table rows

ansgar posted 6 years ago in News
Most HeidiSQL users have used the search/replace dialog. From now on, this dialog does not only support searching in a query editor, but also in data grids and query result rows!

An interesting new feature for users who avoid writing UPDATE queries. And of course for those who want the power of regular expressions with callbacks when modifying table rows.

Thanks to klorinczi for the idea!
BubikolRamios posted 6 years ago
I would suggest another dropdown, under 'blue' ('Search in:')one.
That would be enabled if 'data grid' would be selected and would contain list of columns in grid, like (as per attached image):

All (default)

Ok there is workaround = change query to contain only column which you want to mod by regex, but that is not handy.

ansgar posted 6 years ago
That would duplicate the column selection, and I think the dialog is already crowded enough for such simple search stuff.
BubikolRamios posted 6 years ago
Hmm, was not avare that sorting column is also selecting it.

Anyway I tried in upper case, where the contence of table is constantly changing (delete all, add a bunch of new records), hence a bunch of errors popped up on 'replace all' command.

I guess there is no lock on table when you clic 'replace all' ?
I think lock should be done.
BubikolRamios posted 6 years ago
Yeah ,no lock. Otherwise I would see lock in lower window, right ?
BubikolRamios posted 6 years ago
On second thought, lock, the moment the 'Search and replace text' window is opened. Unless the errors would be cumulatively popede out in lower window after 'replace all' command ...
Without bunch of message boxes.
BubikolRamios posted 6 years ago
Tested on 'fixed' contence table. I guess this shoul do regex replace only on first column in query result grid, as the first columnns is selected by clicking on column title ?

It does not do so, it replacec in complete data grid.

ansgar posted 6 years ago
Well, that's intentionally. Use the column selector to deselect unwanted columns first.
BubikolRamios posted 6 years ago
There is no column selector on data grid that is result of query. Only on data grid as resut of data tab on table.

Point beeeing - I see a big plus of this search & replace & regex thing. It should enable you to do what you can't do in mysql at all, without writing extra program for that.

But, as it is wery likely that I would do regex update based on things that I see in other columns, I don't want them to be hidden.

Obout LOCK from other posts above, I think the best flow would be: replace all
2.lock table
3.reselect based on query (as data mybe changed while looking at dialog) update
5.unlock table
BubikolRamios posted 6 years ago
Mybe general fuctionality of selecting colums in data grid,windows like (MS Excell, OO Calc),
CTRL +Click , SHIFT +click should be implemented.

You would have then sort funczionality limited to sort icon in column title only.

I see many benefits of that.
ansgar posted 6 years ago
> There is no column selector on data grid that is result of query

I meant the data tab, not the query tab. Writing a query, users select columns by the editable query.
Rvanlaak posted 6 years ago
Maybe a "preview changes" function would be nice. No idea how you're managing the change-queries, something with color-highlighting in the grid would be even great.

Please login to leave a reply, or register at first.