db.schemas.util

emtellipro.db.schemas.util

Shared utilities for defining schemas.

Module Contents

Functions

NameDescription
create_metadataCreate a new MetaData instance that can be used with SQLAlchemy Base class. Unless otherwise specified, this will use CONSTRAINT_CONVENTION as the naming convention.
model_lookup_by_table_nameGiven a declarative base class, return the model class with the given table name, or raise LookupError.

Data

CONSTRAINT_CONVENTION

API

emtellipro.db.schemas.util.CONSTRAINT_CONVENTION

emtellipro.db.schemas.util.CONSTRAINT_CONVENTION

A naming convention that’s used

emtellipro.db.schemas.util.create_metadata

emtellipro.db.schemas.util.create_metadata(
naming_convention = None, **kwargs
)

Create a new MetaData instance that can be used with SQLAlchemy Base class. Unless otherwise specified, this will use CONSTRAINT_CONVENTION as the naming convention.

emtellipro.db.schemas.util.model_lookup_by_table_name

emtellipro.db.schemas.util.model_lookup_by_table_name(
cls, table_name
)

Given a declarative base class, return the model class with the given table name, or raise LookupError.