Inbox — API reference¶
Database¶
connection
¶
Context manager that opens and closes an inbox database connection.
ensure_schema
¶
Apply any pending migrations to the database.
Safe to call on every connection open — checks a single integer and returns immediately if the schema is current.
| PARAMETER | DESCRIPTION |
|---|---|
conn
|
Open inbox database connection.
TYPE:
|
get_connection
¶
Open an inbox database connection.
The connection has WAL journal mode enabled (for concurrent reads), foreign-key enforcement enabled, and the current schema applied via migrations.
| PARAMETER | DESCRIPTION |
|---|---|
db_path
|
Override the database path (defaults to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Connection
|
A |
get_project
¶
Return the current project identifier (basename of git root or cwd).
Delegates to mait_code.context.get_project(), falling back to the
current directory name. On the inbox this is only a capture-context hint —
the store itself is global.
Service¶
ItemNotFound
¶
Bases: Exception
Raised by mutations when no inbox item has the given id.
add_item
¶
Insert a captured item and return its new id.
count_items
¶
Return the number of items in the inbox (global unless project given).
get_item
¶
Return one item as a dict, or None if no item has that id.
list_items
¶
Return captured items oldest-first (capture order, for triage).
| PARAMETER | DESCRIPTION |
|---|---|
conn
|
Open inbox connection.
TYPE:
|
project
|
Restrict to one capture-context project, or
TYPE:
|
remove_item
¶
Delete an item permanently (triage routes it out, then removes it).
Raises :class:ItemNotFound if the id is unknown.