Skip to content

Connection

Connection files define database connections and schemas that models can use.

Each connection file should define a database connection and its default catalog (if applicable) and schema. If you need to use additional schemas for the same database, each must be defined in a separate connection file. Database table references (e.g., source in a semantic table) can reference a catalog and schema that the connection can access.

TBD: Explain how a connection relates to an imported MetaKarta database model and its import parameters, like USER. Consider adding source_table, source_table, and source_schema parameters to enable using tables in a non-default catalog and schema.

Sample connection file:

name: Snowflake TPC-H
dialect: Snowflake
catalog: tutorial
schema: tpch

Entity Relationships

classDiagram
class Connection    {
    String dialect [1..1]
    String catalog [0..1]
    String schema [1..1]
    Array~SourceSynonym~ source_synonyms
}
class SourceSynonym {
    String name [1..1]
    String source [1..1]
    String catalog [0..1]
    String schema [1..1]
}
Connection *-- SourceSynonym

Model Properties in Composite Model

dialect

  • Type: string
  • Required: Yes

The name of the dialect.

Supported values:

  • Databricks
  • Snowflake
  • Oracle
  • Hana

catalog

  • Type: string
  • Required: No

The name of the default database catalog. Required for databases that use catalogs (e.g., Snowflake and Databricks) but not for databases like Oracle that do not use catalogs.

schema

  • Type: string
  • Required: Yes

The name of the default database schema.

source_synonyms

  • Type: string
  • Required: No

The synonym (or view) definition of a source (database table or view) residing outside the default catalog or schema.

NOTE: In the data warehouse presentation layer, it’s very common to see separate schemas per subject area or department (e.g., sales_mart, finance_mart, marketing_mart) that “reference” “conformed” schemas that host reusable dimensions (e.g., shared_dims with dim_time and dim_currency). Snowflake and Databricks support multiple catalogs, allowing for the separation of domains, such as organizational boundaries or compliance requirements (e.g., finance_catalog vs. hr_catalog).

Synonyms help models to handle multiple different connections with different catalogs and schema structures.

source_synonyms:
- name: dim_time            # synonym name
  source: dim_time          # name of the source table or view 
  schema: shared_dims       # source schema name
  catalog: shared_catalog   # optional source catalog name

The application implements source_synonyms as database synonyms when the database supports them, or views when it does not.