Skip to content

API Reference parrot.knowledge.wiki.schema.store

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

parrot.knowledge.wiki.schema.store

View source

SchemaStore — SQLiteWikiStore specialisation for schema.db with columns.

Attribute COLUMNS_DDL

Alias ColumnRecord

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

Alias SQLitePragmaPolicy

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

Alias SQLiteWikiStore

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

Class SchemaStore

SQLiteWikiStore specialisation for schema.db with a columns side table.

Parameter Type Default Description
db_path str | Path
wiki_name str 'schema'
read_only bool False
sqlite_policy Optional[SQLitePragmaPolicy] None
persistent_writer bool False

Method SchemaStore.upsert_columns

Replace all rows of each table id present in columns.

upsert_columns(columns: list[ColumnRecord]) -> int

Parameter Type Default Description
columns list[ColumnRecord]

Returns: int

Method SchemaStore.columns_for

Return columns for one table ordered by ordinal.

columns_for(table_id: str) -> list[ColumnRecord]

Parameter Type Default Description
table_id str

Returns: list[ColumnRecord]

Method SchemaStore.find_columns

Find columns by name substring and/or foreign-key target prefix.

find_columns(name: Optional[str] = None, fk_target_prefix: Optional[str] = None, limit: int = 50) -> list[ColumnRecord]

Parameter Type Default Description
name Optional[str] None
fk_target_prefix Optional[str] None
limit int 50

Returns: list[ColumnRecord]

Method SchemaStore.replace_schema_slice

Replace schema pages, edges, and columns atomically.

replace_schema_slice(origin: str, pages: list[WikiPageRecord], columns: list[ColumnRecord], edges: list[tuple[str, str, str, str]]) -> dict[str, Any]

Parameter Type Default Description
origin str
pages list[WikiPageRecord]
columns list[ColumnRecord]
edges list[tuple[str, str, str, str]]

Returns: dict[str, Any]

Method SchemaStore.fold_ddl_table

Fold one DDL-derived table page, never overwriting a live page.

The existing-page check and the resulting write share one immediate transaction, so a concurrent live sync cannot commit in between and then be overwritten by DDL facts.

fold_ddl_table(page: WikiPageRecord, columns: list[ColumnRecord], edges: list[tuple[str, str, str, str]], *, changed_only: bool = False) -> Literal['created', 'updated', 'unchanged']

Parameter Type Default Description
page WikiPageRecord Rendered DDL table page.
columns list[ColumnRecord] Column rows for the table.
edges list[tuple[str, str, str, str]] (src, dst, rel, provenance) edges rendered with the page.
changed_only bool False Skip the write when the stored content hash matches.

Returns: Literal['created', 'updated', 'unchanged'] — "unchanged" when a live page was kept (only defined_in edges are added) or the content hash matched under changed_only; otherwise "created" or "updated".

Alias WikiPageRecord

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

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