Creating a Database Projection
Step-by-step guide to creating a database projection. Learn how to select entities, map properties, choose a database profile, and resolve model types to native column types.
A database projection maps your canonical model entities to database tables and columns. By attaching a database profile, the projection automatically resolves abstract model types (string, number, boolean) to native column types for your chosen platform.
Before You Start
Make sure you have:
- A data model with at least one entity and its properties defined
- A database profile available (NeoArc Studio ships with profiles for PostgreSQL, SQL Server, MySQL, and SQLite)
Step-by-Step Guide
Common Type Mappings
The following table shows how model types typically resolve across database platforms. Actual mappings depend on the selected database profile.
| Model Type | PostgreSQL | SQL Server | MySQL | SQLite |
|---|---|---|---|---|
| string | varchar(255) | nvarchar(255) | varchar(255) | TEXT |
| number | numeric | decimal | decimal | REAL |
| integer | integer | int | int | INTEGER |
| boolean | boolean | bit | tinyint(1) | INTEGER |
| date | date | date | date | TEXT |
| datetime | timestamp | datetime2 | datetime | TEXT |
| uuid | uuid | uniqueidentifier | char(36) | TEXT |
| text | text | nvarchar(max) | longtext | TEXT |
| decimal | numeric(p,s) | decimal(p,s) | decimal(p,s) | REAL |
| bigint | bigint | bigint | bigint | INTEGER |
Working with Relationships
When your model entities have relationships (foreign keys, references), the database projection reflects these as foreign key columns. The projection editor shows relationship pills on properties that reference other entities, making it easy to trace joins across your schema.