Skip to content

src/dazzle_back/runtime/sa_schema.py

Generated: 2026-03-30T04:38:48.111088+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

SQLAlchemy MetaData bridge for EntitySpec.

Converts DSL EntitySpec objects into SQLAlchemy Table objects on a shared MetaData instance. This gives us:

  • Topologically-sorted DDL via metadata.create_all()
  • Automatic cycle handling for circular FKs (use_alter=True)
  • A single source of tru...

Key Exports

  • build_metadata
  • get_sorted_table_names
  • get_circular_ref_edges
  • dfs

Dependencies

Imports

  • __future__.annotations
  • logging
  • typing.TYPE_CHECKING
  • typing.Any
  • typing.cast
  • dazzle_back.specs.entity.EntitySpec
  • dazzle_back.specs.entity.FieldSpec
  • dazzle_back.specs.entity.FieldType
  • dazzle_back.specs.entity.ScalarType
  • sqlalchemy
  • sqlalchemy

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_sa_schema.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.