Skip to main content

Mysql Client

@cachehit/mysql-clientv2026.10.29.1· Apache-2.0· 2d agoBEHAVIORS
01README

Read-only client for MySQL and Aurora MySQL. Checks connectivity, runs parameterized SELECT queries and snapshots table and column metadata, all stored as swamp data.

The network path is yours: point host and port at the database, or at the local end of a tunnel or port-forward you start yourself. The model opens no tunnels and runs no other programs. When nothing is listening it says so instead of printing a socket error.

Writes are refused twice: query only accepts SELECT, WITH, SHOW, DESC/DESCRIBE and EXPLAIN statements, and runs them inside a read-only transaction that is always rolled back.

Quick Start

swamp extension pull @cachehit/mysql-client

# Store the database credentials (prompts for each value)
swamp vault create local_encryption db
swamp vault put db USER
swamp vault put db PASSWORD

swamp model create @cachehit/mysql-client my-db \
  --global-arg host=127.0.0.1 \
  --global-arg port=3308 \
  --global-arg database=app \
  --global-arg 'user=${{ vault.get("db", "USER") }}' \
  --global-arg 'password=${{ vault.get("db", "PASSWORD") }}'

swamp model method run my-db check
swamp model method run my-db query --input-file queries.yaml
swamp model method run my-db schema

Methods

  • check: connect and record the server version, Aurora version (null on plain MySQL), current user, database and read-only flag.
  • query: run one or more named, parameterized read statements over a single connection. Each result is stored as result-<name> with its columns, rows, row count, truncation flag and duration.
  • schema: record the tables and columns of a database from information_schema as schema-<database>.
02Release Notes

Added: First release. check, query and schema connect to a MySQL or Aurora MySQL endpoint, run read-only parameterized queries and record table metadata as swamp data.

03Behaviors1
@cachehit/mysql-clientv2026.10.29.1mysql_client/mysql_client.ts

Global Arguments

ArgumentTypeDescription
host?stringHost to connect to, typically the local end of your port-forward
port?numberTCP port to connect to, typically the local end of your port-forward
database?stringDefault database (schema) to use; optional
userstringMySQL user name
passwordstringMySQL password (store in a vault and reference it via CEL)
connectTimeoutMs?numberConnect timeout in milliseconds
fn check()
Connect and report server version, Aurora version, current user, database and read-only flag
fn query(queries: array, maxRows?: number)
Run one or more parameterized SQL statements inside a read-only transaction that is always rolled back
ArgumentTypeDescription
queriesarray
maxRows?numberMaximum rows kept per query; extra rows are dropped and truncated is set
fn schema(database?: string)
Snapshot the tables and columns of a database from information_schema
ArgumentTypeDescription
database?stringDatabase to describe; defaults to the global database

Resources

connection(7d)— Server identity and session facts from the last check
result(7d)— Rows returned by one read-only query
schema(7d)— Tables and columns of the configured database
04Stats
A
100 / 100
Downloads
0
Archive size
427.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels