Light
Dark
System
v3latest
v3latest
v2
v1

Codegen

edgeql-go is a tool to generate go functions from edgeql queries. When run in an EdgeDB project directory (or subdirectory) a *_edgeql.go source file will be generated for each *.edgeql file. The generated go will have an edgeqlFileName and edgeqlFileNameJSON function with typed arguments and return value matching the query’s arguments and result shape.

Copy
go install github.com/edgedb/edgedb-go/cmd/edgeql-go@latest

See also pinning tool dependencies.

Typically this process would be run using go generate like this:

Copy
//go:generate edgeql-go
Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.