Schema introspection — read current database schema into a SchemaSnapshot.
Supports SQLite and PostgreSQL.
Row access uses the documentedfetch_raw()
contract: every row is a{column_name: value}dict on both backends, so
introspection reads named columns (includingPRAGMAoutput) uniformly.
data.schema.introspect
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Read schema from a SQLite database.
Read schema from a PostgreSQL database.
Auto-detect database backend and introspect its schema.
Dispatches on the live_drivervalue
("sqlite" or "postgresql"), which is set from the connection…
introspect_sqlite
function
async
async def introspect_sqlite(db) -> SchemaSnapshot
Read schema from a SQLite database.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
db
|
|
— |
introspect_postgres
function
async
async def introspect_postgres(db) -> SchemaSnapshot
Read schema from a PostgreSQL database.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
db
|
|
— |
introspect
function
async
async def introspect(db) -> SchemaSnapshot
Auto-detect database backend and introspect its schema.
Dispatches on the live_drivervalue
("sqlite" or "postgresql"), which is set from the connection
URL scheme — not a guessed attribute name.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
db
|
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/data/schema/introspect.py:1