rustledger_query/
lib.rs

1//! Beancount Query Language (BQL) engine.
2//!
3//! This crate provides a SQL-like query language for analyzing Beancount ledger data.
4//!
5//! # Overview
6//!
7//! BQL is a specialized query language designed for financial data analysis.
8//! It operates on transaction postings while respecting double-entry bookkeeping constraints.
9//!
10//! # Query Types
11//!
12//! - `SELECT` - General purpose queries with filtering, grouping, and ordering
13//! - `JOURNAL` - Shorthand for account statements
14//! - `BALANCES` - Shorthand for account balance tables
15//! - `PRINT` - Output filtered transactions in Beancount syntax
16//!
17//! # Example
18//!
19//! ```
20//! use rustledger_query::parse;
21//!
22//! let query = parse("SELECT account, SUM(position) WHERE account ~ \"Expenses:\" GROUP BY account").unwrap();
23//! println!("{:?}", query);
24//! ```
25
26#![forbid(unsafe_code)]
27#![warn(missing_docs)]
28
29pub mod ast;
30pub mod completions;
31pub mod error;
32pub mod executor;
33pub mod parser;
34pub mod price;
35
36pub use ast::*;
37pub use error::{ParseError, QueryError};
38pub use executor::{Executor, QueryResult, Value};
39pub use parser::parse;
40pub use price::PriceDatabase;