Report
CQRS report configuration.
Defines reports that support zero-cliff scalability from
startup (Code Reports) to enterprise (Analytics with OLAP).
Attributes:
name: Unique report identifier
report_type: Report execution mode (Code Report or Analytics Report)
data_source: Data source adapter (SQL, Elastic, ClickHouse)
query: Report query (SQL file path, SQL query, or Elastic DSL)
enabled: Whether the report is active
Source: report.py
Fields
| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| name | str | ✓ | Unique report identifier | minLen: 1, maxLen: 255 |
| report_type | str | ✓ | Report execution mode: 'Code Report' (indie) or 'Analytics Report' (enterprise) | - |
| data_source | str | None | Data source adapter: SQL, Elastic, ClickHouse (for Analytics Reports) | |
| query | str | None | Report query: SQL file path, SQL query, or Elastic DSL JSON | |
| enabled | bool | Whether the report is active | - |
Permissions
| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| Admin | ✓ | ✓ | ✓ | ✓ |
| Employee | ✓ | |||
| Manager | ✓ | ✓ | ✓ |
Configuration
| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting