Spaces:
Sleeping
Sleeping
Database Provisioning
These snippets bootstrap GitRag persistence for both libSQL and PostgreSQL.
Shared Logical Schema
Both providers use the same logical chunks fields:
id, repo, branch, path, languagestart_row, start_col, end_row, end_colstart_bytes, end_byteschunk, status, mutation_idembedding(provider-specific type)search_vector(nativetsvectorin postgres; nullable text parity field in libSQL)
Embedding Dimension
The embedding size is defined by EMBEDDING_DIMENSIONS in
packages/core/src/constants.py (currently 768).
If this constant changes, update provisioning/postgres/schema.sql.
libSQL
- Install
sqlx,litecli, or usetursoCLI to connect. - Run
libsql/schema.sql. - Verify with
PRAGMA table_info(chunks);andSELECT name FROM sqlite_master WHERE name='chunks_fts';.
PostgreSQL
- Connect to the target database (the database itself must already exist).
- Run
postgres/schema.sql. - Verify with
\d chunksand\di chunks_*.
Syncing
If you point the indexer at a local SQLite file, pass the remote URL/token via
sync_url and auth_token (the SQLAlchemy adapter handles this automatically).
MCP Server
packages/mcp-server does not define its own database tables.
Its entrypoint is run_space.py.
It calls Retriever, which reads from the same chunks persistence schema above.