Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.omni.co/llms.txt

Use this file to discover all available pages before exploring further.

Aliasing lets you reference a view by an additional name. This is useful for handling database table renames and for creating duplicate views needed in join logic.
Aliased views are best paired with topics and may not appear as views in All Views and Fields in the workbook. Additionally, aliased views can’t be extended.

Handling table name changes

If the name of view’s base table changes in the database, it can cause content in Omni to break. Use the aliases parameter to add the table’s original name(s), which will allow Omni to find the correct table in the database.

Duplicating views with aliases

In some cases, you may need to duplicate a view - for example, a users view that contains both buyers and sellers. Aliased views are automatically created when you define them as joins in the model’s Relationships file. The following example demonstrates how to alias the users view to create buyers and sellers views. Note that the names of the aliased views are used to declare the joins:
relationships.yaml
- join_to_view: users
  join_to_view_as: buyers
  join_type: always_left
  relationship_type: many_to_one
  on_sql: ${order_items.user_id} = ${buyers.id}
  reversible: false

- join_to_view: users
  join_to_view_as: sellers
  join_type: always_left
  relationship_type: many_to_one
  on_sql: ${order_items.user_id} = ${sellers.id}
  reversible: false