Bug 473731 - user input SQL statment to search
Summary: user input SQL statment to search
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (other bugs)
Version First Reported In: 8.1.0
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-24 16:15 UTC by Kane
Modified: 2023-08-24 16:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kane 2023-08-24 16:15:56 UTC
SUMMARY
***
I wish there's an input slot to let user directly write SQL statment (or critiera) to search photos in the Advanced Search pop up(or maybe another "super advanced" pop up). 
Even better, on any display which listing the photos(left tabs, left tabs combined with right tabs, Advanced Serach result, etc.), user can check current SQL critiera so that when he/she writes his/her own SQL for advanced search, he/she can copy & enhance the condition or reference the column/value from the existings.

I understand you've already provided the very powerful "Advanced Search" function. However, there're two issues:
1, after extending a condition category, too much space is occupied. Sometimes I just need one field from one category, but the screen is then full of other useless fields so it's hard for me to get an overview of all the conditions I set, I have to scroll up up up and down down down a lot, this is not friendly to use
2, there's no option for me to "group conditions(Search Groups)". I know I can add multiple conditions, and swithcing AND/OR relationships. But how to group them? A and (B or C), (A and B) or C ? There's no way I can do that. 

Thus, a SQL input will be a great help. 
(If a full SQL statment will cause security issue, how about only the conditions? Or you can warn user like "Using SQL search will at your own risk...."... something like that)
***

STEPS TO REPRODUCE
n/a

OBSERVED RESULT
n/a

EXPECTED RESULT
n/a

SOFTWARE/OS VERSIONS
any OS

ADDITIONAL INFORMATION
(none)
Comment 1 Maik Qualmann 2023-08-24 16:31:08 UTC

*** This bug has been marked as a duplicate of bug 428545 ***
Comment 2 Maik Qualmann 2023-08-24 16:38:38 UTC
My personal opinion is - no, we will never let the user run SQL code directly. Also, some of our functions need to execute different SQL code depending on SQLite or MySQL because there are differences. Just as an example to get the part of a date in the SQL statement.
No, we don't want to support that.

Maik
Comment 3 Kane 2023-08-24 16:54:17 UTC
Hi Maik,

Thanks for your reply. I now understand you have your concerns and will not provide SQL input.
But, could you please take a thought about my problem below?

- On current Advance Serach function, there's no option for me to "group conditions(Search Groups)". I know I can add multiple conditions, and swithcing AND/OR relationships. But how to group them? A and (B or C), (A and B) or C ? There's no way I can do that. 

Thanks!
Kane