Collections
Collections are the foundational data model in Minerva. Every collection represents a logical table in your database, but with more capability than a raw SQL table.
Definition
A collection is stored in the Blueprint and encapsulates table_metadata, an include_map for relational querying, a record_label expression, and metadata for the five standard
routes.
1. Column Types
Minerva supports several rich data types tailored for business apps:
- Text: Strings, enums, long-form content
- Numeric: Integers, decimals, currency
- Boolean: True/false flags
- Date/Timestamp: Time-sensitive workflows
- Record Link: Relations to rows in other collections
Minerva handles the underlying foreign key constraints and join tables automatically.
2. The include_map
Record Links let you build complex relationship graphs. The include_map determines which
relations are eagerly fetched when you query a collection.
When you configure an include_map, Minerva handles the corresponding SQL joins
automatically while still enforcing field-level access.
3. Record Labels (CEL)
The record_label is a CEL expression that computes a string label for a record.
This is useful for:
- Combining name fields
- Appending status text
- Formatting a more useful display label than a raw ID
4. DDL Generation Pipeline
When you save changes to a collection:
- Minerva validates the schema update
- Generates the necessary PostgreSQL DDL statements
- Computes the reverse delta for history
- Applies the migration to the tenant database
That means you do not need to hand-author migration scripts for routine structural changes.