ashlr__sql
Run SQL against SQLite or Postgres and return a compact, token-dense text result.
Server: ashlr-sql — servers/sql-server.ts
Collapses the typical "shell out to psql/sqlite3 + reparse stdout" loop into one tool call. Supports SQLite (via bun:sqlite) and Postgres (via porsager/postgres). Returns results as a compact table, truncating large result sets.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
query | string | yes | SQL query to execute |
connection | string | no | SQLite file path or Postgres DSN (default: auto-detect from env) |
limit | number | no | Max rows to return (default: 50) |
Output format
Returns a compact ASCII table:
Driver detection
- If
connectionends in.db,.sqlite, or.sqlite3— SQLite driver - If
connectionstarts withpostgres://orpostgresql://— Postgres driver - If
connectionis omitted — readsDATABASE_URLenv var, then looks for*.sqlitein cwd
Example
Unsupported
MySQL and MSSQL are not supported in v1.x. A clear error is returned if a MySQL DSN is passed.
Related tools
ashlr__bash— raw shell fallback if you needpsqlflags