Logo
NeoArc Studio

Data Projections

Create data projections that transform model entities for specific database targets with vendor-specific type resolution, naming conventions, and structural transformations.

Purpose-Specific Database Representations

Each data projection targets a specific database or data store. A database profile controls type resolution, so a model property of type string becomes varchar(255) in PostgreSQL, nvarchar(max) in SQL Server, or String in MongoDB. Property names, types, and structures can all transform to match the conventions of the target system. The canonical model stays unchanged - the projection handles the translation.

Database Profiles
Pluggable profiles for PostgreSQL, SQL Server, MySQL, MongoDB, Cosmos DB, DynamoDB, and more. Each profile defines type mappings, naming conventions, and vendor-specific constraints.
Property Transformation
Nine transformation types cover everything from simple renames to complex calculations. The expression builder handles cases where a direct mapping is not sufficient.
Structural Modes
Flat mode creates peer tables with foreign key relationships. Nested mode creates hierarchical structures with a root entity and embedded children, suited to document databases.
Conflict Detection
When source and target types do not align, the system detects and categorises the conflict - type conversion, truncation risk, null handling, or precision loss - so nothing is silently lost.

The Transformation Engine

Data projections use nine transformation types to map model properties to database columns. Each type serves a specific purpose, from straightforward copies to complex multi-field calculations.

TypeDescription
DirectCopy the value as-is from source to target. The simplest mapping, used when the field name and type match.
RenameCopy the value but change the field name. Useful for adapting to database naming conventions (camelCase to snake_case).
Type-CastConvert the value to a different type. For example, a string date field becomes a native date column in the database.
AggregateCompute an aggregate value from a collection. Count, sum, average, min, max over related entities.
ConcatenateCombine multiple source fields into a single target field. Join first name and last name into a full name column.
CalculateApply arithmetic or date calculations. Derive age from date of birth, or compute a total from quantity and unit price.
DeriveCreate a field that does not exist in the source model. Surrogate keys, audit timestamps, and computed flags.
SplitBreak a single source field into multiple target fields. Split an address string into street, city, and postcode columns.
CustomWrite a free-form expression using field references, functions, and conditional logic for cases that do not fit the other types.

Expression Builder

For complex transformations, the expression builder provides a structured way to define mapping logic. It supports field references using {entity.field} syntax, SQL-like functions for string manipulation, date arithmetic, and mathematical operations. CASE/WHEN statements handle conditional transformations, and explicit CAST operations control type conversion. Expressions are stored as structured data in the projection JSON file, making them readable in pull request diffs.

Expression Functions
String functions (CONCAT, UPPER, LOWER, TRIM, SUBSTRING), date functions (DATEADD, DATEDIFF, YEAR, MONTH), and math functions (ROUND, FLOOR, CEILING, ABS) for building transformation logic.
Conflict Resolution
When the expression builder detects a type mismatch between source and target, it suggests appropriate CAST operations and flags potential data loss before you save.