Skip to content

Instantly share code, notes, and snippets.

@kylebrandt
Last active October 29, 2025 16:22
Show Gist options
  • Select an option

  • Save kylebrandt/340fde1b2f78ea9b8da30301a6c7cec0 to your computer and use it in GitHub Desktop.

Select an option

Save kylebrandt/340fde1b2f78ea9b8da30301a6c7cec0 to your computer and use it in GitHub Desktop.
Grafana GMS Fork

SQL Expressions Go MySQL Fork Notes

Why a Fork?

For dolthub/go-mysql-server, MySQL compatibility is a top priority. For Grafana, avoiding Cgo is a top priority. dolthub/go-mysql-server uses Cgo for regex by default. You can disable it with a build tag, but then people have to know about that build tag for things like go test (and Mac users have issues with the dependency, we tried and go Makefile and CI working, but then realized we would still have this bump for devs).

So this is a minimal fork which makes non-cgo the default.

References

Update Procedure

This is a draft, need to run through it (Not optimal I don't think, steps probably can be better.)

Note: You will never merge into main.

  1. Go to grafana/go-mysql-server
  2. Click Sync Fork in the Github UI.
  3. checkout the no_cgo_default, merge main into the branch
  4. push to the branch
  5. Not the commit hash of your merge into main on this branch.
  6. Tag that branch, e.g. git tag v0.20.1-grafana2 abc123xz
  7. Maybe wait a little bit, I think you can mess up go caching if you try to fetch this to fast
  8. Switch to grafana/grafana, find the replace direction for the fork in go.mod, update it to the new tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment