Documentation
¶
Overview ¶
Package filter provides composable SQL clause builders for querying tasks. Filters compose with AND semantics by default; use Or for OR semantics.
Virtual tag registry. New tags are registered via init() in virtual_*.go category files. This file never needs to change when adding new tags.
Index ¶
- func BuildTaskQuery(filters ...Filter) (string, []any)
- func ComputeVirtualTags(task *taskkit.Task, now time.Time) []string
- func IsVirtualTag(name string) bool
- type Clause
- type Filter
- func BlockedBy(dependsOnID string) Filter
- func Blocking(taskID string) Filter
- func CreatedAfter(t time.Time) Filter
- func CreatedBefore(t time.Time) Filter
- func DeadlineAfter(t time.Time) Filter
- func DeadlineBefore(t time.Time) Filter
- func DescriptionContains(s string) Filter
- func DescriptionIs(s string) Filter
- func DisplayID(id int) Filter
- func HasDeadline() Filter
- func HasProject() Filter
- func HasScheduled() Filter
- func HasTag(tag string) Filter
- func HasWait() Filter
- func ID(id string) Filter
- func LacksTag(tag string) Filter
- func ModifiedAfter(t time.Time) Filter
- func ModifiedBefore(t time.Time) Filter
- func NoDeadline() Filter
- func NoProject() Filter
- func NoScheduled() Filter
- func NoWait() Filter
- func Or(filters ...Filter) Filter
- func Project(name string) Filter
- func ProjectPrefix(prefix string) Filter
- func ScheduledAfter(t time.Time) Filter
- func ScheduledBefore(t time.Time) Filter
- func Status(s taskkit.Status) Filter
- func StatusAny(statuses ...taskkit.Status) Filter
- func WaitAfter(t time.Time) Filter
- func WaitBefore(t time.Time) Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTaskQuery ¶
BuildTaskQuery assembles a full SELECT against the tasks table with all provided filters ANDed together. With no filters it returns all tasks.
func ComputeVirtualTags ¶
ComputeVirtualTags returns the names of all virtual tags that apply to task, sorted alphabetically. Called at the client layer after full hydration.
func IsVirtualTag ¶
IsVirtualTag reports whether name is a registered virtual tag. The lookup is exact - virtual tag names are uppercase by convention.
Types ¶
type Filter ¶
type Filter func() Clause
Filter is a function that returns a Clause.
func CreatedAfter ¶
CreatedAfter matches tasks created after t.
func CreatedBefore ¶
CreatedBefore matches tasks created before t. Since task_id is a ULID, lexicographic comparison is equivalent to time comparison.
func DeadlineAfter ¶
DeadlineAfter matches tasks whose deadline is after t.
func DeadlineBefore ¶
DeadlineBefore matches tasks whose deadline is before t.
func DescriptionContains ¶
DescriptionContains matches tasks whose description contains s (case-insensitive).
func DescriptionIs ¶
DescriptionIs matches tasks whose description exactly equals s.
func HasScheduled ¶
func HasScheduled() Filter
HasScheduled matches tasks with a scheduled date set.
func HasTag ¶
HasTag matches tasks that have the given tag, or whose state matches the named virtual tag if the name is registered (e.g. "BLOCKED", "OVERDUE"). Virtual tag names are uppercase by convention; "blocked" still matches the stored tag.
func LacksTag ¶
LacksTag matches tasks that do not have the given tag, or whose state does not match the named virtual tag if the name is registered.
func ModifiedAfter ¶
ModifiedAfter matches tasks whose most recent history entry is after t.
func ModifiedBefore ¶
ModifiedBefore matches tasks whose most recent history entry is before t.
func ProjectPrefix ¶
ProjectPrefix matches tasks whose project name starts with prefix.
func ScheduledAfter ¶
ScheduledAfter matches tasks whose scheduled date is after t.
func ScheduledBefore ¶
ScheduledBefore matches tasks whose scheduled date is before t.
func WaitBefore ¶
WaitBefore matches tasks whose wait date is before t.