Logo
NeoArc Studio

Database Profiles

Database profiles map abstract model types to vendor-specific concrete types with parameterised templates, naming conventions, and fidelity loss detection. Design your model once and generate correct DDL for any database vendor, with built-in vendor templates covering SQL Server, PostgreSQL, MySQL, Oracle, MongoDB, SQLite, Snowflake, MariaDB, CockroachDB, Azure Table Storage, Azure Cosmos DB, Amazon DynamoDB, and Apache Cassandra.

A model property with abstract type string means different things to different databases. In SQL Server, it is NVARCHAR(255). In PostgreSQL, it is VARCHAR(255) or TEXT. In MongoDB, it is simply String. Without a translation layer, architects must either pick a vendor upfront and lose portability, or maintain separate schema definitions for each target database.

Database profiles provide that translation layer. Each profile defines a mapping from abstract types to concrete database types, a naming convention for tables and columns, and parameterised templates that use property constraints to generate precise DDL types. The model stays vendor-agnostic. The profile handles the vendor-specific details.

Abstract Type Mappings

Each profile maps abstract types to concrete types for a specific database vendor.

Abstract TypeSQL ServerPostgreSQLMySQLOracleMongoDB
stringNVARCHAR({maxLength})VARCHAR({maxLength})VARCHAR({maxLength})VARCHAR2({maxLength})String
textNVARCHAR(MAX)TEXTLONGTEXTCLOBString
integerINTINTEGERINTNUMBER(10)Number
floatFLOATDOUBLE PRECISIONDOUBLEBINARY_DOUBLENumber
decimalDECIMAL({precision},{scale})NUMERIC({precision},{scale})DECIMAL({precision},{scale})NUMBER({precision},{scale})Decimal128
booleanBITBOOLEANTINYINT(1)NUMBER(1)Boolean
dateDATEDATEDATEDATEDate
datetimeDATETIME2TIMESTAMPTZDATETIME(6)TIMESTAMPDate
uuidUNIQUEIDENTIFIERUUIDCHAR(36)RAW(16)String
jsonNVARCHAR(MAX)JSONBJSONCLOBObject
binaryVARBINARY(MAX)BYTEALONGBLOBBLOBBinData
enumNVARCHAR(50)TEXTENUM(...)VARCHAR2(50)String

Parameterised Templates

Type mappings use parameterised templates that substitute values from property constraints. This allows the concrete type to adapt to each property's specific requirements.

Template VariableSourceFallbackExample
{maxLength}property.maxLengthMAXNVARCHAR(255) when maxLength=255, NVARCHAR(MAX) when unset
{minLength}property.minLength-Used in CHECK constraints
{precision}property.maxValue-DECIMAL(18,2) when maxValue=18
{scale}property.scale2DECIMAL(18,4) when scale=4
{minValue}property.minValue-Used in CHECK constraints
{maxValue}property.maxValue-Used in CHECK constraints

Naming Conventions

Each profile defines a naming convention that controls how entity and property names from the model are transformed when displayed in Data Views or exported as DDL.

ConventionModel NameResolved NameDefault Vendor
PascalCaseorder_itemOrderItemSQL Server
snake_caseorderItemorder_itemPostgreSQL, MySQL
SCREAMING_SNAKE_CASEorderItemORDER_ITEMOracle
camelCaseOrderItemorderItemMongoDB
kebab-caseOrderItemorder-item-
Train-CaseorderItemOrder-Item-
dot.caseorderItemorder.item-
flatcaseOrderItemorderitem-
UPPERFLATCASEorderItemORDERITEM-
noneorderItemorderItem (unchanged)-

Fidelity Loss Detection

Not all databases support all features equally. When switching from one database profile to another, the system checks for fidelity loss and warns about potential issues.

Fidelity IssueExampleSeverity
Missing type mappingAbstract type has no concrete type in the target profileError
Text-based UUIDMySQL uses CHAR(36) instead of a native UUID typeWarning
Text-based JSONSQL Server uses NVARCHAR(MAX) instead of native JSONBWarning
No native enum supportPostgreSQL uses TEXT instead of ENUM for enum typesInfo
Emulated booleanMySQL uses TINYINT(1) instead of a native BOOLEAN typeInfo

Profile File Format

Database profiles are stored as .neoarc-db-profile.json files in the project. Each profile is self-contained with all type mappings and conventions.

Resolution Flow

When a persistence mode Data View renders an entity, the following resolution chain applies: