@synthryn/sypi-mysql
v0.6.0-beta.20260816.6a00fcae
Published
Optional extension: Run gated read-only SQL against configured MySQL and Postgres connections, with production unlocks and rollback-only transactions. Use it when the agent needs bounded database inspection rather than writes. Primary capability: the mysq
Readme
sypi-mysql
Optional read-only SQL access for SyPi. Runs gated SELECT/SHOW/DESCRIBE/EXPLAIN
against configured MySQL (and Postgres) connections. dev-* and test-* connections
are freely usable; prod-* connections are refused unless a human unlocks one
in-session, with a 30-minute TTL, via /mysql.
Layout
index.ts- the extension: themysqltool, the/mysqlcommand, and all picker/flow logic.gate.ts- the read-only boundary (pure; no I/O). Refuses stacked statements, comments, version comments, writes, and every parser-differential bypass that was confirmed against node-sql-parser.dialect.ts- per-engine facts the gate needs (one row per supported engine).db.ts- execution paths, one driver per engine (mysql2, pg). Every query runs insideSTART TRANSACTION READ ONLYand is always rolled back.tunnel.ts- SSH bastion forwarding for Workbench-style connections, host key verified fail-closed against~/.ssh/known_hosts.config.ts- the connection registry at product-statemysql.json, plus the profile-first cost-budget and connection-allowlist settings (read from the host-projectedmysqlsettings block viareadScopedSettings).import.ts- parse MySQL Workbenchconnections.xmland JDBC key=value/JSON.explain.ts- EXPLAIN plan legibility and the cost-budget estimate.audit.ts- append-only query audit log.credential-store.ts- the OS credential store (keyring) helper the package needs at runtime; carried locally so the published package never depends on a product-internal subpath alias.
Notes
- Passwords never touch
mysql.json; they live in the credential store. - A fresh connection is used per query and always closed; no pooling.
profile.mysqlsettings (cost budget, connection allowlist) are read from the host-projected scoped-settings block; the host applies project-trust gating.
