Skip to main content
Use get_dql_schema to discover what tables and columns are available for a collection. This is useful for programmatically building queries.

Get Schema

from docent import Docent

client = Docent()

schema = client.get_dql_schema("my-collection-id")
for table in schema["tables"]:
    print(f"\nTable: {table['name']}")
    for col in table["columns"]:
        print(f"  {col['name']}: {col['data_type']}")

Parameters

collection_id
str
required
ID of the collection.

Returns

schema
dict
Schema response containing tables and rubrics.

Example: Find Metadata Columns

schema = client.get_dql_schema(collection_id)

# Find the agent_runs table
agent_runs_table = next(t for t in schema["tables"] if t["name"] == "agent_runs")

# List all columns
for col in agent_runs_table["columns"]:
    print(f"  {col['name']} ({col['data_type']}, nullable={col['nullable']})")