Skip to content

feat: implement a query interface#22

Merged
webern merged 5 commits intomainfrom
queries
Jan 10, 2026
Merged

feat: implement a query interface#22
webern merged 5 commits intomainfrom
queries

Conversation

@webern
Copy link
Owner

@webern webern commented Jan 9, 2026

No description provided.

webern added 2 commits January 9, 2026 08:39
- Add OutputFormat enum (json/markdown/csv), QueryArgs, and SchemaArgs
to support the new query interface. Add stub implementations in the
database layer and wire up CLI commands in main.rs. Create new
commands/query.rs module with Rows and Schema types.

- Add JsonSchema derive to AutoCat and Category structs, and add
field_descriptions() method to Item trait that extracts field
descriptions from JsonSchema doc comments.

- Add read-only SQLite connection pool to Db struct for query isolation.
Implement execute_query() to run arbitrary SQL and return results in
JSON, Markdown, or CSV format. Implement get_schema() to return
database schema including tables, columns, indexes, foreign keys,
row counts, and field descriptions extracted from JsonSchema.

- Add MCP tools for executing read-only SQL queries and retrieving
database schema information. The query tool supports json, markdown,
and csv output formats. The schema tool returns table structure,
column info, indexes, foreign keys, and field descriptions.

- Document the new query and schema MCP tools in the usage instructions,
including parameters, output formats, example queries, schema structure,
and updated best practices.
@webern webern force-pushed the queries branch 2 times, most recently from 139bbca to 125ad83 Compare January 10, 2026 01:55
Apparently I have to publish my patch of the Oxide sheet crate if I want to
publish this library. I have also added some tags for crates.io.
@webern webern merged commit 1588560 into main Jan 10, 2026
5 checks passed
@webern webern deleted the queries branch January 10, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant