Documentation Index
Fetch the complete documentation index at: https://mintlify.com/felixdotgo/querybox/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theexec command executes a user query against a data source and returns structured results. Supports SQL databases, document stores, and key-value stores.
Command Invocation
ExecRequest object
Stdout: JSON-encoded ExecResponse object
Timeout: 30 seconds
Required: Yes - all driver plugins must implement this command
Request Parameters
Response Structure
Contains exactly one of:
sql, document, or kv payloadError message if execution failed. Empty string indicates success.
ExecResult Payloads
SqlResult (for relational databases)
Array of column metadata objects:
name(string, required): Column nametype(string, optional): Database type (e.g., “varchar”, “int”)
Array of row objects, each containing:
values(string[]): Array of string-formatted cell values
DocumentResult (for document stores)
Array of JSON objects representing documents
KeyValueResult (for key-value stores)
String-to-string map of key-value pairs
Example Implementation
Fromplugins/mysql/main.go:
Request Format (stdin)
Response Format (stdout)
SQL Result Example
Error Response Example
Value Formatting
Useplugin.FormatSQLValue() helper to convert database/sql scan results:
nilvalues → empty string""[]bytewith valid UTF-8 → string conversion[]bytewith binary data → hex format"0x...”- Other types →
fmt.Sprintf("%v", value)
Error Handling
- Return errors in the
errorfield of the response, not via stderr or exit code - The host displays error messages directly to the user
- Empty
errorfield indicates success - The
resultfield should be omitted or empty when an error occurs
Notes
- All row values must be strings - the plugin is responsible for formatting
- Binary data should be hex-encoded to avoid invalid JSON
- The host does not parse or interpret query syntax - that’s plugin-specific