Skip to content

API Reference parrot.knowledge.wiki.schema.service

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.knowledge.wiki.schema.service

View source

Schema-plane application service backed by :class:SchemaStore.

Alias BaseWikiStore

Re-exported from parrot.knowledge.wiki.store.BaseWikiStore.

Alias Completeness

Re-exported from parrot.knowledge.wiki.schema.table_metadata.Completeness.

Alias LookupResult

Re-exported from parrot.knowledge.wiki.schema.models.LookupResult.

Alias SchemaPlaneConfig

Re-exported from parrot.knowledge.wiki.schema.models.SchemaPlaneConfig.

Class SchemaPlaneReader

Read/write surface consumed by the database cache tier.

Method SchemaPlaneReader.get_table

get_table(origin: str, schema: str, table: str) -> Optional[TableMetadata]

Parameter Type Default Description
origin str
schema str
table str

Returns: Optional[TableMetadata]

Method SchemaPlaneReader.put_table

put_table(origin: str, dialect: str, metadata: TableMetadata) -> None

Parameter Type Default Description
origin str
dialect str
metadata TableMetadata

Method SchemaPlaneReader.list_tables

list_tables(origin: str, schema: Optional[str] = None) -> list[str]

Parameter Type Default Description
origin str
schema Optional[str] None

Returns: list[str]

Class SchemaPlaneService

Coordinate schema sync, lookup, relationship traversal, and search.

Parameter Type Default Description
store SchemaStore
config SchemaPlaneConfig
plane_dir Path
shared_root Optional[Path]

Attributes:

Attribute Type Description
store SchemaStore Return the backing schema store.

Method SchemaPlaneService.from_root

Open the schema plane at the effective shared project root.

from_root(root: Optional[Path] = None) -> 'SchemaPlaneService'

Parameter Type Default Description
root Optional[Path] None

Returns: 'SchemaPlaneService'

Method SchemaPlaneService.from_dir

Open a rootless schema plane without resolving a project checkout.

from_dir(plane_dir: Path, *, config: Optional[SchemaPlaneConfig] = None, read_only: bool = True) -> 'SchemaPlaneService'

Parameter Type Default Description
plane_dir Path
config Optional[SchemaPlaneConfig] None
read_only bool True

Returns: 'SchemaPlaneService'

Method SchemaPlaneService.sync

Introspect an origin and persist its resulting schema slice.

sync(origin: str, *, tables: Optional[list[str]] = None, changed_only: bool = False, dsn_resolver: Optional[Callable[[str], str]] = None, toolkit: Any = None) -> SyncReport

Parameter Type Default Description
origin str
tables Optional[list[str]] None
changed_only bool False
dsn_resolver Optional[Callable[[str], str]] None
toolkit Any None

Returns: SyncReport

Method SchemaPlaneService.ingest_ddl

Fold SQL files into the plane, allowing DDL only to fill live-table gaps.

ingest_ddl(paths: list[Path], *, origin: str, dialect: str, changed_only: bool = False, root: Optional[Path] = None) -> SyncReport

Parameter Type Default Description
paths list[Path] SQL migration files to fold.
origin str Source alias for the resulting table records.
dialect str SQL dialect used to parse the files.
changed_only bool False Skip DDL records whose stored content hash is unchanged.
root Optional[Path] None Base directory used to derive stable migration file identifiers.

Returns: SyncReport — A report of created, updated, unchanged, and parse-error records.

Method SchemaPlaneService.diff

Report differences between live facts and configured DDL without resolving them.

diff(origin: str, *, live: Optional[list[TableRecord]] = None) -> list[dict[str, Any]]

Parameter Type Default Description
origin str Source alias to compare.
live Optional[list[TableRecord]] None Optional live records. When omitted, live records are rebuilt from stored pages.

Returns: list[dict[str, Any]] — Difference rows containing table_id, field, live, and ddl.

Method SchemaPlaneService.lookup

Look up a table using only stored schema-plane records.

lookup(ref: str, *, annotation_store: Optional[BaseWikiStore] = None) -> LookupResult | list[str]

Parameter Type Default Description
ref str Table reference in any form accepted by normalize_ref.
annotation_store Optional[BaseWikiStore] None Optional (usually federated) wiki store whose about edges to the table are merged into annotations. wiki_remember writes its note and edge to the local wiki plane, never to schema.db, so without this the lookup cannot see them.

Returns: LookupResult | list[str] — The lookup payload, or the candidate ids when ref is ambiguous.

Method SchemaPlaneService.neighbors

Traverse table relationships breadth-first to the requested depth.

neighbors(ref: str, *, depth: int = 1, rel: Optional[str] = 'references') -> list[dict[str, Any]]

Parameter Type Default Description
ref str
depth int 1
rel Optional[str] 'references'

Returns: list[dict[str, Any]]

Method SchemaPlaneService.search

Search table pages and column names, retaining unique table hits.

search(query: str, *, limit: int = 20) -> list[dict[str, Any]]

Parameter Type Default Description
query str
limit int 20

Returns: list[dict[str, Any]]

Method SchemaPlaneService.sources

Return configured schema sources.

sources() -> list[SchemaSourceConfig]

Returns: list[SchemaSourceConfig]

Method SchemaPlaneService.get_table

Rebuild stored metadata without introspecting a database.

get_table(origin: str, schema: str, table: str) -> Optional[TableMetadata]

Parameter Type Default Description
origin str
schema str
table str

Returns: Optional[TableMetadata]

Method SchemaPlaneService.put_table

Write one metadata entry through the schema plane.

put_table(origin: str, dialect: str, metadata: TableMetadata) -> None

Parameter Type Default Description
origin str
dialect str
metadata TableMetadata

Method SchemaPlaneService.list_tables

List stored tables for one origin, optionally narrowed to a schema.

list_tables(origin: str, schema: Optional[str] = None) -> list[str]

Parameter Type Default Description
origin str
schema Optional[str] None

Returns: list[str]

Alias SchemaSourceConfig

Re-exported from parrot.knowledge.wiki.schema.models.SchemaSourceConfig.

Alias SchemaStore

Re-exported from parrot.knowledge.wiki.schema.store.SchemaStore.

Alias SyncReport

Re-exported from parrot.knowledge.wiki.schema.models.SyncReport.

Alias TableMetadata

Re-exported from parrot.knowledge.wiki.schema.table_metadata.TableMetadata.

Alias TableRecord

Re-exported from parrot.knowledge.wiki.schema.models.TableRecord.

Alias content_hash

Re-exported from parrot.knowledge.wiki.schema.render.content_hash.

Alias find_shared_root

Re-exported from parrot.knowledge.wiki.project.find_shared_root.

Alias introspect

Re-exported from parrot.knowledge.wiki.schema.producers.live.introspect.

Alias load_effective_config

Re-exported from parrot.knowledge.wiki.project.load_effective_config.

Attribute logger

Alias normalize_ref

Re-exported from parrot.knowledge.wiki.schema.ids.normalize_ref.

Alias parse_table_id

Re-exported from parrot.knowledge.wiki.schema.ids.parse_table_id.

Alias render_page

Re-exported from parrot.knowledge.wiki.schema.render.render_page.

Alias render_schema_page

Re-exported from parrot.knowledge.wiki.schema.render.render_schema_page.

Alias render_source_page

Re-exported from parrot.knowledge.wiki.schema.render.render_source_page.

Alias schema_concept_id

Re-exported from parrot.knowledge.wiki.schema.ids.schema_concept_id.

Alias source_concept_id

Re-exported from parrot.knowledge.wiki.schema.ids.source_concept_id.

Alias split_namespaced_id

Re-exported from parrot.knowledge.wiki.context.split_namespaced_id.

Alias sqlite_policy_from_config

Re-exported from parrot.knowledge.wiki.project.sqlite_policy_from_config.

Alias table_concept_id

Re-exported from parrot.knowledge.wiki.schema.ids.table_concept_id.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally