asopi tech
asopi techIndie Developer

Asopitech With · Task manager

Todoist filters with Alopex DB

Todoist is a task manager for capturing tasks the moment they come to you and organizing them with projects, labels and filters. What if we rebuilt it with Alopex DB?

Updated: Oct 13, 2026

What the service does

In Todoist you capture tasks in natural language and organize them with projects and labels. Labels group similar tasks across projects. Filters are custom views of your tasks written with a query syntax. This page rebuilds tasks and filters.

Where the data lives

  • Alopex DB SQL tables: tasks, projects, sections, labels and the task-label mapping live in SQL tables.
  • SQL: filter conditions become SQL conditions that join due dates, priorities, labels and projects.
  • Full-text search: task names and notes are found with full-text search.

Reading due dates out of the task text is the job of the app code.

Deployment

Alopex DB is embedded in the phone and desktop apps. Tasks are on hand, so they open right away. Tasks shared with a team are received by an Alopex DB server on the same engine.

Why Alopex DB fits

Task data is the relationship between tasks, projects and labels, plus the conditions that slice it. Alopex DB keeps those relationships in SQL tables and runs filters as SQL conditions on the device.

See it in code

Tasks and labels live in SQL tables, and a filter becomes a SQL condition. Just the core.

import alopex
from datetime import date, timedelta

# Alopex DB を端末の中のデータの層にする(アプリに組み込む想定)
db = alopex.Database.open("todoist.alopex")

# タスクとラベルを SQL テーブルで持つ(ラベルはプロジェクトをまたいでまとめる)
db.execute_sql("""
    CREATE TABLE IF NOT EXISTS tasks (
        id INTEGER PRIMARY KEY,
        content TEXT NOT NULL,
        project TEXT,
        priority INTEGER,
        due DATE
    )
""")
db.execute_sql("""
    CREATE TABLE IF NOT EXISTS task_labels (
        task_id INTEGER,
        label TEXT
    )
""")

# タスクを書き留める
db.execute_sql(
    "INSERT INTO tasks (id, content, project, priority, due) VALUES (?, ?, ?, ?, ?)",
    [1, "請求書を送る", "仕事", 3, "2026-10-24"],
)
db.execute_sql(
    "INSERT INTO task_labels (task_id, label) VALUES (?, ?)",
    [1, "@お金"],
)

# フィルター=SQL の条件。「今週が期限・優先度が高い・@お金のタスク」
week_end = (date.today() + timedelta(days=7)).isoformat()
rows = db.execute_sql(
    """
    SELECT t.id, t.content, t.due
    FROM tasks AS t
    JOIN task_labels AS l ON l.task_id = t.id
    WHERE t.due <= CAST(? AS DATE)
      AND t.priority >= 3
      AND l.label = ?
    ORDER BY t.due
    """,
    [week_end, "@お金"],
)

for row in rows:
    print(row["due"], row["content"])

The filter combines due date, priority and label in one SQL query (CAST(? AS DATE) keeps the date typed). Change the view by changing the conditions.

Embed Alopex DB, which writes filters directly as SQL conditions, in your task app.