Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.buttons.sh/llms.txt

Use this file to discover all available pages before exploring further.

SQL buttons will wrap a parameterized query as a pressable action. The query lives as a file inside the button folder, the database connection is resolved from a reusable credential stored in Buttons’ credential system, and arguments are bound as query parameters (not string-interpolated).
# Planned shape
buttons create top-users \
  --sql ./queries/top-users.sql \
  --db analytics-prod \
  --arg limit:int:optional
Press it:
buttons press top-users --arg limit=50 --json

Blocked on

Credential storage (autonoco/autono#264 — batteries). The SQL preset depends on being able to:
  • Register a database connection once (buttons store db analytics-prod --url 'postgres://...')
  • Reference it by name from any button (--db analytics-prod)
  • Share the same credential across multiple SQL buttons without re-specifying

What’s changing when batteries lands

  • --sql <file> flag reads the query from disk, copies it into the button folder
  • --db <name> resolves to a stored connection string
  • Arguments bind as parameters, not string substitution — no SQL injection surface
  • Supported drivers: Postgres first, then MySQL, then SQLite