Skip to content

Added args, kwargs search - #20

Open
Sand0ra wants to merge 1 commit into
taskiq-python:mainfrom
Sand0ra:feat/args-search
Open

Sand0ra wants to merge 1 commit into
taskiq-python:mainfrom
Sand0ra:feat/args-search

Conversation

@Sand0ra

@Sand0ra Sand0ra commented Oct 16, 2026

Copy link
Copy Markdown

Add a second search field on the tasks page to look for text inside a
task's args and kwargs. It works alongside the existing name search.

API / backend:

  • New argsSearch query param on GET /api/tasks (zod schema, QueryParams type)
  • TasksRepository.getAll accepts args and filters by substring over
    args || ' ' || kwargs:
    • postgres: lower(...) LIKE, backed by a new optional gin_trgm index
      idx_taskiq_admin_tasks__args_trgm (needs pg_trgm, warns if missing)
    • sqlite: LIKE ... ESCAPE '' (case-insensitive for ASCII only)
  • User input is escaped, so % and _ are matched literally

Name search fixes:

  • postgres: use lower(name) LIKE, so the existing gin_trgm index is used
  • sqlite: queries shorter than 3 characters fall back to LIKE, because
    the FTS5 trigram tokenizer cannot match them

UI (tasks/index.vue):

  • New "Search args / kwargs..." input; Enter submits both fields
  • Search inputs are filled from the URL query on load
  • Submitting resets to page 1 and clears empty fields
    (before, an empty search could not be cleared)
  • "Clear Filters" also clears both inputs

@spikeninja

Copy link
Copy Markdown
Collaborator

Hey, thank you for you PR

Could you pls take out all fixes (use lower(name) like, ...) into a separate PR so that we can merge it irrespective of the args/kwargs search?

I’m not sure about adding a GIN index on the kwargs field, because in some cases it can bloat the table due to the column’s JSON type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants