By default, Omni will assign fields labeled like
id or table_id as primary keys when generating a model. For example, the users_id on a users table. Primary keys can also be automatically set using dbt constraints.primary_key declaration - for example, compound keys like CONCAT(id, '-', user_id) - Omni recommends creating a new field and setting that field as the primary key. Alternatively, for compound primary keys, you can set custom_compound_primary_key_sql at the view level to define an array of fields that make up the view’s primary key.
Syntax
Properties
The name of the dimension. Dimension names must:
- Be unique within the view
- Start with a letter
- Contain only alphanumeric characters and underscores
Examples
Simple primary key
Compound primary key