rental.db file.
Full source:
examples/rental/Schema
Quickstart
Metrics
| Metric | Source · measure | Canonical for |
|---|---|---|
rental_revenue | payments.total_paid | Settled revenue across all payment methods |
rental_count | rentals.completed_rental_count | Number of completed agreements |
avg_rental_duration | rentals.avg_rental_days | Mean actual days held per completed rental |
Guardrail
completed-rentals-only: rentals.total_base_revenue must never be summed without a status = 'completed' filter: active and cancelled rows have NULL in total_amount. Use payments.total_paid for financial reporting instead.
Cross-fact fanout (documented in a knowledge caveat, not a guardrail;
required_dimension/cross-fact fanout guarding isn’t an enforced guardrail kind yet, see Contracts & guardrails): joining damages to payments in a single query fans out both facts. Always bridge each independently through rentals.