PRIMARY_KEY
Key constraints
Note that the supported behaviour with key constraints varies between database management systems. Check DBMS specific documentation.
Defining a PRIMARY_KEY for an entity creates a primary key in the target database.
See also:
Usage
Pick one or several attributes to form the key and give a name to the key.
Notes
Check Export SQL/Entity SQL after defining a PRIMARY_KEY to see generated DDL.
Agile Data Engine does not create primary keys in Azure Synapse SQL. Azure Synapse SQL only supports primary keys with NONCLUSTERED and NOT ENFORCED options, and use of primary keys may cause queries to return inaccurate results when there are duplicate entries. Please refer to Microsoft documentation for more details.
Examples
Defining a primary key for a table
Key definition:
KEY NAME: PK_F_TRIP
KEY TYPE: PRIMARY_KEY
ATTRIBUTE 1: trip_wid
DDL generated by Agile Data Engine:
CREATE TABLE pub.F_TRIP (
...,
CONSTRAINT PK_F_TRIP PRIMARY KEY (trip_wid)
);