Expand description
Driver-specific pool and transaction plugins for sqlx.
Three stateful plugins — SqlxPgPlugin, SqlxSqlitePlugin,
SqlxMySqlPlugin — each holding named persistent pools and open
transactions by Uuid handle. The agent calls pg__connect(url) to
obtain a pool_id, then references that ID in subsequent tool calls.
§Architecture
Agent calls pg__connect(url)
→ PgPool stored in plugin.pools[uuid]
→ pool_id: Uuid returned
Agent calls pg__begin(pool_id)
→ Transaction<'static, Postgres> stored in plugin.transactions[uuid]
→ tx_id: Uuid returned
Agent calls pg__tx_execute(tx_id, sql)
→ transaction removed from registry, used, re-inserted on success or error
→ QueryResultData returned
Agent calls pg__commit(tx_id)
→ transaction removed and committedAll three plugins expose the same 14-tool surface under their respective
namespaces (pg__, sqlite__, mysql__), generated by the
[impl_driver_plugin!] macro.
Structs§
- Begin
Result - Response from
*__begin: transaction handle. - Connect
Params - Parameters for
*__connect: establish a new named pool. - Connect
Result - Response from
*__connect: handle for subsequent tool calls. - Pool
IdParams - Parameters for tools that reference a pool by ID.
- Pool
SqlParams - Parameters for direct-pool SQL execution tools.
- Pool
Stats Result - Response from
*__pool_stats. - Sqlx
MySql Plugin - Stateful MCP plugin for
MySQLdatabase operations. - Sqlx
PgPlugin - Stateful MCP plugin for
PostgreSQLdatabase operations. - Sqlx
Sqlite Plugin - Stateful MCP plugin for
SQLitedatabase operations. - TxId
Params - Parameters for transaction lifecycle tools.
- TxSql
Params - Parameters for transactional SQL execution tools.
Functions§
- decode_
mysql_ row - Decode a
sqlx::mysql::MySqlRowinto a serializableRowData. - decode_
pg_ row - Decode a
sqlx::postgres::PgRowinto a serializableRowData. - decode_
sqlite_ row - Decode a
sqlx::sqlite::SqliteRowinto a serializableRowData. - mysql_
args_ from_ json - Bind a slice of
serde_json::Valueintosqlx::mysql::MySqlArguments. - mysql_
query_ result - Convert a MySQL execute result to
QueryResultData. - pg_
args_ from_ json - Bind a slice of
serde_json::Valueintosqlx::postgres::PgArguments. - pg_
query_ result - Convert a Postgres execute result to
QueryResultData. - sqlite_
args_ from_ json - Bind a slice of
serde_json::Valueintosqlx::sqlite::SqliteArguments. - sqlite_
query_ result - Convert a SQLite execute result to
QueryResultData.