Skip to content

introspection

introspection

Live Database Schema Introspection

This module handles Input 3 of the django-migration-audit architecture: the live database schema (ground truth).

It introspects the actual database state via Django's connection introspection API, providing the "actual" side for Comparison B: Reality Check (expected ↔ actual).

The core question this module helps answer: "What actually exists in the database right now?"

This is the ground truth that both migration history and migration code must ultimately match.

DJANGO_INTERNAL_TABLE_PREFIXES = ('django_', 'auth_', 'sqlite_') module-attribute

is_internal_table(table_name)

Check if a table is a Django internal table.

introspect_schema(using='default')

Introspect the live database schema and return a SchemaState.

Parameters:

Name Type Description Default
using str

Database alias to introspect

'default'

Returns:

Type Description
SchemaState

SchemaState representing the actual database schema