Skip to main content
This workshop is a docs transcript of demos/enterprise/01_connect_and_ingest.py. It uses the committed seed database at demos/data/warehouse.db.
You will enable the optional database extension, ingest an existing SQLite warehouse into browsable db-* rows, and discover tables through normal HeavenBase queries and card search.

1. Prerequisites

From a HeavenBase source checkout with SQL extras synced:

2. Enable the Database Extension

The database extension registers six schema entities: db-database, db-table, db-column, db-enum, db-snippet, and db-predicate. Enable it explicitly when ingesting from Python:

3. Ingest an Existing Database

hb.ext.ingest_database accepts a workspace SQL backend name, DSN, local SQLite path, or hb.Database instance. It uses SQLAlchemy inspect() and redacts credentials in stored rows:
Run the full script:

4. Browse Schema Rows

Query ingested tables and columns like any other entity:
Discover tables with text search:

Summary

  • The database extension introspects external SQL databases into first-class HeavenBase entities.
  • Ingestion redacts credentials; re-run ingest after manifest import when live connection metadata is needed.
  • Schema rows are queryable and searchable before you register SQL snippets or expose MCP tools.

Further Exploration

Related resources: