darktable-org / darktable-org/darktable
Add SQL where statement to collection rules
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
There are some (lots) of collections that can't be built using the current collection rules, such as collecting all images shot in a month irrespective of year as was discussed in https://discuss.pixls.us/t/filtering-collection-on-capture-date-but-by-month-only/51621
Describe the solution you'd like
The ability to write a SQL where clause such as strftime("%m", datetime_taken) = '05', which would be appended to select * from images where . The example given would select all images shot in May.
Alternatives
Perhaps a query builder, but I think that would be horribly difficult to make usable without making it huge.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how collection rules become the select * from images where query and identify the entry point that could accept a user-supplied SQL WHERE clause. Check how the example strftime("%m", datetime_taken) = '05' would be represented, and consider the feature complete when a collection can select all images from a month regardless of year.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100