loom.core.locator¶
Locate one application from its configuration file.
load_application is the single entry point the Alembic environment, the
command line and the schema tools share: it reads the file named by
LOOM_CONFIG (or an explicit path), discovers the models the same way the
server does, compiles them into a MetaData owned by the returned
Application and builds the bootstrap declaration from the database
section. A missing key raises ConfigError naming it; nothing is defaulted.
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load, discover and compile the application described by |
Classes
|
One application: its models compiled into their own metadata and its declarations. |
|
The |
|
The |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- class loom.core.locator.SchemaConfig(*, mode='create_all', allow_unprotected_dialect=False, name=None, roles=None, database_users=None, scopes=None, guard=None, groups=None, version_tables=None, naming_convention=None)[source]¶
Bases:
StructThe
database.schemasection; every name is absent until the product writes it.naming_conventionis handed to the application’sMetaDataas SQLAlchemy’snaming_convention, keyed bypk,fk,uq,ckandix; absent, SQLAlchemy’s default applies.
- class loom.core.locator.DatabaseConfig(*, url, schema=<factory>)[source]¶
Bases:
StructThe
databasesection as the locator reads it.- Parameters:
url (str)
schema (SchemaConfig)
- class loom.core.locator.Application(models, metadata, database, bootstrap, scoped, scope_sources)[source]¶
Bases:
objectOne application: its models compiled into their own metadata and its declarations.
- Parameters:
metadata (MetaData)
database (DatabaseConfig)
bootstrap (BootstrapConfig | None)
scoped (Mapping[tuple[str | None, str], ScopedTable])
- loom.core.locator.load_application(config_path=None)[source]¶
Load, discover and compile the application described by
config_path.- Raises:
ConfigError – When the path is missing, a required key is absent or a value has the wrong shape; the message names the key.
- Parameters:
config_path (str | None)
- Return type: