Skip to content

Add custom table for querying custom directives#282

Open
yeatse wants to merge 1 commit into
beancount:masterfrom
yeatse:feature/custom-table
Open

Add custom table for querying custom directives#282
yeatse wants to merge 1 commit into
beancount:masterfrom
yeatse:feature/custom-table

Conversation

@yeatse
Copy link
Copy Markdown

@yeatse yeatse commented May 16, 2026

Summary

Adds a custom table exposing Beancount custom directives, with the same shape as the existing notes / events / documents tables.

Columns:

Column Type Description
meta dict Directive metadata (filename, lineno, …)
date date Directive date
type str The custom directive type string
values list Typed values as parsed by Beancount

Example::

SELECT date, type, values FROM custom WHERE type = 'budget' ORDER BY date

Test plan

  • New beanquery/custom_test.py covers: column schema, SELECT * wildcard excludes meta, row contents with mixed value types (string / Amount / date), WHERE type = filtering, meta contents, empty ledger
  • Updated shell_test.py .tables expectation
  • Full suite: 299 passed

🤖 Generated with Claude Code

Expose Beancount ``custom`` directives as a queryable table with
``meta``, ``date``, ``type``, and ``values`` columns, mirroring the
existing ``notes`` / ``events`` / ``documents`` tables. ``values`` is a
list of typed values as parsed by Beancount.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant