> ## 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.

# dynamic_schemas

> Creates a copy of the specified schema as a virtual schema.

Creates a copy of the specified schema as a virtual schema. The views in the dynamic schema are generated from the schema specified in `from_schema`. When generating SQL against dynamic schema views, the `user_attribute` assigned to the user running the query is used to scope table references.

If you're using [embedding](/embed), you can use this setting to partition customer data into separate, but identical schemas.

All modeling will reference views in the dynamic schema with this naming convention: `dynamic_schema_name__view_name`

## Syntax

```yaml theme={null}
dynamic_schemas:
  <dynamic_schema_name>:
    from_schema: <canonical_schema_name>
    user_attribute: <user_attribute_name>
```

## Properties

<ParamField path="dynamic_schema_name" type="string" required>
  The name of the new dynamic schema.

  <Expandable title="dynamic_schema_name properties" defaultOpen="true">
    <ParamField path="from_schema" type="string" required>
      The name of the schema to copy.
    </ParamField>

    <ParamField path="user_attribute" type="string" required>
      The reference of the user attribute to use to scope table references.
    </ParamField>
  </Expandable>
</ParamField>
