Skip to content

Schema

laktory.models.resources.databricks.Schema ¤

Bases: SchemaBase

A schema (also called a database) is the second layer of Unity Catalog's three-level namespace. A schema organizes tables and views.

Examples:

import io

from laktory import models

schema_yaml = '''
catalog_name: dev
name: engineering
grants:
- principal: domain-engineering
  privileges:
  - SELECT
'''
schema = models.resources.databricks.Schema.model_validate_yaml(
    io.StringIO(schema_yaml)
)
References
BASE DESCRIPTION
catalog_name

Name of the catalog storing the schema

TYPE: str | VariableType DEFAULT: None

comment

User-provided free-form text description.

TYPE: str | None | VariableType DEFAULT: None

enable_predictive_optimization

Whether predictive optimization should be enabled for this object and objects under it.

TYPE: str | None | VariableType DEFAULT: None

force_destroy

If True schema can be deleted, even when not empty

TYPE: bool | VariableType DEFAULT: True

metastore_id

Unique identifier of parent metastore.

TYPE: str | None | VariableType DEFAULT: None

name

Name of schema, relative to parent catalog.

TYPE: str | VariableType

owner

Username of current owner of schema.

TYPE: str | None | VariableType DEFAULT: None

properties

A map of key-value properties attached to the securable.

TYPE: dict[str, str] | None | VariableType DEFAULT: None

storage_root

Storage root URL for managed tables within schema.

TYPE: str | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
grant

Grant(s) operating on the Schema and authoritative for a specific principal. Other principals within the grants are preserved. Mutually exclusive with grants.

TYPE: SchemaGrant | list[SchemaGrant] | VariableType DEFAULT: None

grants

Grants operating on the Schema and authoritative for all principals. Replaces any existing grants defined inside or outside of Laktory. Mutually exclusive with grant.

TYPE: list[SchemaGrant | VariableType] | VariableType DEFAULT: None

tables

List of tables stored in the schema

TYPE: list[Table | VariableType] | VariableType DEFAULT: []

volumes

List of volumes stored in the schema

TYPE: list[Volume | VariableType] | VariableType DEFAULT: []

ATTRIBUTE DESCRIPTION
additional_core_resources
  • schema grants

TYPE: list

full_name

Schema full name {catalog_name}.{schema_name}

TYPE: str

parent_full_name

Catalog full name {catalog_name}

TYPE: str

resource_key

Schema full name (catalog.schema)

TYPE: str

additional_core_resources property ¤

  • schema grants
  • tables
  • volumes

full_name property ¤

Schema full name {catalog_name}.{schema_name}

parent_full_name property ¤

Catalog full name {catalog_name}

resource_key property ¤

Schema full name (catalog.schema)