golemcloud/golem/golem-add-mysql-go
- community
Checking that the SKILL.md file is still in the repository.
Using MySQL from a Go Golem agent via the golem/rdbms/mysql wrapper. Use when the user asks to connect to MySQL, run SQL, scan rows, or execute a MySQL transaction in a Go Golem project.
Install
npx vskill@latest install golemcloud/golem/golem-add-mysql-goSKILL.md
Using MySQL from a Go Agent
Overview
The Go SDK ships a durable MySQL client at github.com/golemcloud/golem/sdks/go/golem/rdbms/mysql. It mirrors the postgres wrapper: open a connection with a URL, then run parametrised statements in a database/sql-flavoured style. Every query, execute, and commit is journaled and replayed, so the connection is durable across restarts.
There is no native driver and no raw socket — all traffic goes through the golem:rdbms host, so nothing needs wiring beyond importing the subpackage. Unlike Postgres, MySQL has no recursive value families, so every value maps directly to a Go value.
Steps
- Import
.../golem/rdbms/mysqlin your agent'simplpackage. - Open a connection with
mysql.Open(addr)anddefer db.Close(). - Exec / Query with
?placeholders; pass plain Go values or typed constructors. - Scan rows with
row.Scan(&dst…)or the typed getters. - Transactions via
db.Transaction(func(tx *mysql.Tx) error { … }).
Prefer a config value or env var for the connection string over hardcoding it (see golem-add-config-go).
Definition (agents/notes/notes.go)
Implementation (agents/notes/impl/impl.go)
golem.Must unwraps (value, error) and panics on error, failing the invocation without retry; golem.Must0 does the same for an error-only return like Scan.
Parameters and Row Getters
Parameters are ordinary Go values — nil, bool, the signed and unsigned int widths, float32/float64, string, []byte, and time.Time map to their natural MySQL types:
When the exact column type matters (decimal, a specific integer width, json, enum), build the parameter with a constructor from the package — each returns a mysql.DbValue:
Read columns back positionally with the typed getters on mysql.Row — Int64, Uint64, Float64, String, Bool, Bytes, Time, the generic Get, or Scan. Each returns (value, error):
rs.Columns() returns the []mysql.Column metadata (Ordinal, Name, DbTypeName).
Transactions
db.Transaction runs a closure inside a transaction, committing if it returns nil and rolling back otherwise. The error is the closure's, joined with the rollback's when that fails too:
For manual control use db.Begin() then tx.Exec / tx.Query and tx.Commit() or tx.Rollback().
Returning Host Errors to the Caller
golem.Must* turns a returned host error into a panic, which traps the component and fails the invocation without retry. To let the caller observe a failure as a value instead, keep the fallible call's error and model the method output as golem.Result[Ok, Err]:
Key Constraints
- Target is WASM only: no native
go-sql-driver/mysql, no raw sockets. All SQL goes through thegolem:rdbmshost — just import.../rdbms/mysql. - The connection is durable: every query/execute/commit is journaled and replayed. Because these are remote side effects, using the client inside a read-only method traps (see
golem-mark-read-only-go). - Placeholders are
?(MySQL style). Postgres uses$1, $2, …— seegolem-add-postgres-go. - Bare
intmaps tobigint; usemysql.Int(...)for a 32-bit integer column and the*Unsignedconstructors (or plainuint*values) for unsigned columns. All getters and fallible calls return(value, error)— pair them withgolem.Must/golem.Must0. - An unsupported plain parameter type errors at encode time with a message telling you to wrap it in a
mysql.*constructor.
Related Skills
| Skill | When to Load | |
|---|---|---|
golem-add-agent-go | Create the agent that owns this MySQL client | |
golem-add-postgres-go | Use PostgreSQL instead of (or alongside) MySQL | |
golem-add-config-go | Read the connection string from typed config | |
golem-add-transactions-go | Coordinate a saga across agents (distinct from a single DB transaction) | |
golem-mark-read-only-go | Understand why DB calls trap in read-only methods |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggolem-skills/skills/go/golem-add-mysql-go/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/golemcloud/golem/golem-add-mysql-go)