What is dbprint?
dbprint profiles database tables and saves their DDL, joins, and column-level statistics as plain-text files for a code repository. It is designed for teams using coding agents or developers who need to understand database contents without repeatedly connecting to a live system. The saved print can be read offline through a CLI context command, an MCP server, or a packaged skill, while human- or agent-written annotations capture meanings the measurements cannot determine.
dbprint Features:
Database Support: Adapters cover PostgreSQL, MySQL, Snowflake, BigQuery, Databricks, Redshift, ClickHouse, DuckDB, and SQLite.
Schema And Joins: Each table's print includes normalized DDL and join relationships, including inferred links when the schema declares none, with observed fanout and target coverage.
Column Statistics: Profiles can include null rates, value lists, ranges, percentiles, distributions, cardinality, and inferred value shapes for individual columns.
Offline Agent Context: The context command, MCP server, and packaged skill let agents use committed prints without a live database connection or database credentials.
Human Annotations: The annotate command prepares table-specific questions for an agent, while separate note files preserve explanations without being overwritten by dbprint.
Drift Checks: Prints include machine-readable drift information, and dbprint check can be used in CI to gate changes to the stored database profile.
Value Redaction: Rules can mask, drop, or hash values by column name, detected sensitivity, or shape while retaining counts.
dbprint Benefits:
Fewer Repeat Queries: Agents and developers can reuse a committed profile instead of rerunning the same investigative queries in each session, reducing repeated warehouse work and query costs.
Clearer Data Meaning: Measured values alongside written explanations help teams distinguish what the database contains from what a code or column means.
More Reliable SQL: Knowing a column's full value domain, spelling variations, and join behavior can help prevent missed rows and mistaken assumptions in queries.
Reviewable Changes: Keeping prints in version control makes database changes easier to inspect alongside code, helping teams spot changes that may affect downstream work.
Safer Shared Prints: Configurable redaction gives teams a way to limit exposure of sensitive cell values in committed profiles while preserving useful counts.
Use Cases:
Agent SQL Drafting: Give a coding agent offline context about tables, joins, and column values before it writes a query for an application or report.
Report Debugging: Check whether unexpected spellings, nulls, or value distributions explain why a report's filters omit records or produce surprising results.
Schema Change Review: Compare updated database prints during code review or CI to investigate structural or data-profile changes before they affect dependent code.
Database Onboarding: Help a developer or coding agent explore an unfamiliar database using committed profiles, without requiring a connection during each review.
Business Rule Notes: Record what a status code, sentinel date, or report exclusion means next to the measured profile so later sessions can use that context.

