RPTMeta is a YAML-based specification for defining enterprise-grade report templates. It provides a structured way to define SQL reports with variables, caching strategies, and scheduling capabilities.
- Declarative report definitions using YAML
- Variable system with type checking and validation
- Built-in caching configuration
- Report scheduling support
- SQL query templating with variable interpolation
- Comprehensive metadata and versioning
- Tag-based organization
An RPTMeta file consists of three main sections:
- Report Metadata
- Variables Definition
- SQL Query Template
report:
title: "Get Workers with Expired Licenses"
description: "Identifies workers whose licenses have expired."
version: 1
tags:
- "Compliance"
- "Workers"
caching:
isCachable: true
cacheDuration: 600
scheduling:
isScheduled: false
variables:
- name: "workerStatus"
placeholder: "${workerStatus}"
type: "string"
default: "Active"
description: "Status of workers to include in the report."
isRequired: true
allowedValues: ["Active", "Inactive"]
sql: |
SELECT "w"."first_name", "w"."last_name"
FROM "workers" AS "w"
WHERE "w"."status" = ${workerStatus};
Field | Type | Required | Description |
---|---|---|---|
title | string | Yes | Report title |
description | string | Yes | Detailed description of the report's purpose |
version | integer | Yes | Report template version |
tags | string[] | No | Array of tags for categorization |
caching | object | No | Caching configuration |
scheduling | object | No | Scheduling configuration |
Each variable can have the following properties:
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Variable identifier |
placeholder | string | Yes | SQL placeholder (format: ${name}) |
type | string | Yes | Data type (string, integer, float, boolean, date, datetime) |
default | any | No | Default value |
description | string | Yes | Variable description |
isRequired | boolean | No | Whether the variable is mandatory |
allowedValues | array | No | List of valid values |
The SQL section contains the parameterized query template. Variables are referenced using the ${variableName}
syntax.
RPTMeta files should use the .rptmeta.yaml
extension. Example:
workers.rptmeta.yaml
Supported variable types:
string
: Text valuesinteger
: Whole numbersfloat
: Decimal numbersboolean
: True/false valuesdate
: Date values (YYYY-MM-DD)datetime
: Date and time values
caching:
isCachable: true # Enable/disable caching
cacheDuration: 600 # Cache duration in seconds
scheduling:
isScheduled: true # Enable/disable scheduling
schedule: "0 0 * * *" # Cron expression
-
All SQL queries are validated for:
- SQL injection prevention
- Proper variable usage
- Query structure
- Maximum length limits
-
Variables are validated for:
- Type safety
- Allowed values
- Required fields
- Create a new file with
.rptmeta.yaml
extension - Define the report metadata
- Specify required variables
- Write the SQL query template
- Validate using the provided tools
-
Compliance Reports:
- License expiration tracking
- Certification monitoring
- Audit reports
-
Operational Reports:
- Worker status reports
- Equipment maintenance schedules
- Inventory tracking
-
Analytics Reports:
- Performance metrics
- Trend analysis
- KPI tracking
The RPTMeta ecosystem includes:
- Schema validator
- SQL query validator
- Template parser
- Report generator
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
This project is licensed under the MIT License - see the LICENSE file for details.