Crate rustledger_query

Crate rustledger_query 

Source
Expand description

Beancount Query Language (BQL) engine.

This crate provides a SQL-like query language for analyzing Beancount ledger data.

§Overview

BQL is a specialized query language designed for financial data analysis. It operates on transaction postings while respecting double-entry bookkeeping constraints.

§Query Types

  • SELECT - General purpose queries with filtering, grouping, and ordering
  • JOURNAL - Shorthand for account statements
  • BALANCES - Shorthand for account balance tables
  • PRINT - Output filtered transactions in Beancount syntax

§Example

use rustledger_query::parse;

let query = parse("SELECT account, SUM(position) WHERE account ~ \"Expenses:\" GROUP BY account").unwrap();
println!("{:?}", query);

Re-exports§

pub use error::ParseError;
pub use error::QueryError;
pub use executor::Executor;
pub use executor::QueryResult;
pub use executor::Value;
pub use parser::parse;
pub use price::PriceDatabase;
pub use ast::*;

Modules§

ast
BQL Abstract Syntax Tree types.
completions
BQL query completion engine.
error
BQL error types.
executor
BQL Query Executor.
parser
BQL Parser implementation.
price
Price database for currency conversions.