DuplicateUnitError (cq/store.py)

cq · sdk/python/src/cq/store.py · python · Apache-2.0
database

Exception for duplicate knowledge unit IDs, abstracting driver errors.

# Source: https://github.com/mozilla-ai/cq | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Local persistence for cq: the Store SPI and its SQLite default.

The ``Store`` Protocol is the narrow contract the Client depends on; the
default ``SqliteStore`` implements it over SQLite following the XDG Base
Directory spec. Default location: $XDG_DATA_HOME/cq/local.db
(~/.local/share/cq/local.db). The store auto-creates the database
directory and schema on first use and implements the context manager
protocol for deterministic resource cleanup.

``create_store`` resolves a connection-string URL to a concrete store, and
``rank_candidates`` is the shared ranker any implementation can reus

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key