Bug 119093 - Add "Find" and "Find/Replace" dialog in SQL Query Editor in Base
Summary: Add "Find" and "Find/Replace" dialog in SQL Query Editor in Base
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Base-UX
  Show dependency treegraph
 
Reported: 2018-08-04 18:19 UTC by Roman Kuznetsov
Modified: 2019-06-03 07:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2018-08-04 18:19:48 UTC
Description:
Add dialogue "Find" in SQL Query Editor in Base

Steps to Reproduce:
1. Add dialogue "Find" in SQL Query Editor in Base


Actual Results:
There is no dialogue "Find" in SQL Query Editor in Base

Expected Results:
There is dialogue "Find" in SQL Query Editor in Base


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Robert Großkopf 2018-08-05 14:26:50 UTC
You need a special dialog for finding something in the query-editor? Please declare it a little bit. I don't see much content where I would have to search through in the editor and to find anything.

Do you need the dialog for finding something when creating code in direct SQL? Here I would use an external Editor to find and replace content.
Comment 2 Alex Thurgood 2018-08-06 09:38:27 UTC
(In reply to robert from comment #1)

> Do you need the dialog for finding something when creating code in direct
> SQL? Here I would use an external Editor to find and replace content.

I would tend to disagree with you here Robert - if the whole point of having a manual SQL editor is to allow the user to type / paste in queries of his/her own making, then it should also allow for Search/Replace, otherwise the same reasoning could be applied to the Basic IDE Editor too.

Confirming with

Version: 6.2.0.0.alpha0+
Build ID: 36e1f6ebf0c74b4b90bbf1aab8d9ab69b8746f3a
CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 3 Alex Thurgood 2018-08-08 07:33:53 UTC
@Robert : as an example of where it would be useful, consider a query with multiple sub-queries spanning several lines in the SQL editor and containing repeated use of a table column, or alias, or parameter.

As a personal example, whilst attempting the ongoing translation of your DB-Guide work, it would have been very useful to have such a tool to search and replace column names by their corresponding language translations in the queries.
Comment 4 Robert Großkopf 2018-08-08 07:50:00 UTC
(In reply to Alex Thurgood from comment #3)
> @Robert : as an example of where it would be useful, consider a query with
> multiple sub-queries spanning several lines in the SQL editor and containing
> repeated use of a table column, or alias, or parameter.

The description of the bug was so short I didn't recognize it should be the input in direct SQL, not through the GUI.

For long code indeed it should be useful to add a find and find→replace-function here. So I must't copy the code to an external editor for doing the same.
Comment 5 Julien Nabet 2018-08-08 18:59:34 UTC
I don't know at all how to add this feature, uncc myself.
Comment 6 Drew Jensen 2018-08-08 22:15:18 UTC
Well, there is already a 'Find' function in the query editor, the 'Filter' functions, Auto Filter and Standard Filter available from the toolbar. 

The Form Grid control then adds to that with the Form-Based filter. 

The all act as a find function, IMO.

I would agree that a Replace function would be a very good addition.

I would suggest that the place to attach the interface for that would be the table (rowset) grid component. 

Doing that the functionality could make it available to the Table view, the query designer view and the form grid control. 

I would suggest it honor the filter settings as currently coded, so work with the rowset as displayed not the total underlying table, if you want that just drop any filter setting before use the replace function.

Question then is what do you want to replace?

Maybe a good candidate for a generalized way to say that, the replacement could be a constant of a function with the contents of a given column as input and the result replacing the content of that column, applied to each record in the rowset.

Is this what you folks are thinking of?
Comment 7 Drew Jensen 2018-08-08 22:16:41 UTC
correct a typo here: 
 
 Maybe a good candidate for a generalized way to say that, the replacement
 could be a constant OR a function with the contents of a given column as
 input and the result replacing the content of that column, applied to each
 record in the rowset.
Comment 8 Robert Großkopf 2018-08-09 05:46:43 UTC
@Drew,

seems we are talking about different things. As I understood this bug is about the query-editor in SQL-mode. If there is a lot of code, and, for example, you will change "name" to "forename", you have to search along the whole SQL-code written down.

Better would be a find/replace solution, but this isn't implemented here. Is implemented in "simple" texteditors. Linux, for example, the editor "Kate". 

And if there is anybody who could change something and will do it: There is another functionality I am missing: If I click, with a texteditor, on a bracket, I see the closing bracket is marked too. Another argument for me to put the whole code in a texteditor, change it there and put it back to the SQL-editor.
Comment 9 Drew Jensen 2018-08-09 15:06:26 UTC
(In reply to robert from comment #8)
> @Drew,
> 
> seems we are talking about different things. As I understood this bug is
> about the query-editor in SQL-mode. If there is a lot of code, and, for
> example, you will change "name" to "forename", you have to search along the
> whole SQL-code written down.
> 
> Better would be a find/replace solution, but this isn't implemented here. Is
> implemented in "simple" texteditors. Linux, for example, the editor "Kate". 
> 
> And if there is anybody who could change something and will do it: There is
> another functionality I am missing: If I click, with a texteditor, on a
> bracket, I see the closing bracket is marked too. Another argument for me to
> put the whole code in a texteditor, change it there and put it back to the
> SQL-editor.

Ah so it is. As for a workflow, I often do the same and use an external editor for anything beyond trivial select statements also.