Documentation
¶
Overview ¶
Package codegen orchestrates the generation of Go code from SQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportedIdentifier ¶
ExportedIdentifier converts raw input into a public Go identifier.
func UnexportedIdentifier ¶
UnexportedIdentifier converts raw input into a private Go identifier.
Types ¶
type Generator ¶
type Generator interface {
Generate(ctx context.Context, catalog *model.Catalog, analyses []analyzer.Result) ([]File, error)
}
Generator produces Go code from parsed schemas and queries.
type GeneratorFactory ¶
type GeneratorFactory struct {
// contains filtered or unexported fields
}
GeneratorFactory creates language-specific generators.
func NewGeneratorFactory ¶
func NewGeneratorFactory(opts Options) *GeneratorFactory
NewGeneratorFactory creates a new generator factory.
type Options ¶
type Options struct {
Package string
Database config.Database
EmitJSONTags bool
EmitEmptySlices bool
EmitPointersForNull bool
Prepared PreparedOptions
CustomTypes []config.CustomTypeMapping
SQL SQLOptions
}
Options configures the Generator.
type PreparedOptions ¶
PreparedOptions configures prepared statement generation.
type SQLOptions ¶
SQLOptions configures SQL schema output.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ast provides types and logic for building Go ASTs.
|
Package ast provides types and logic for building Go ASTs. |
|
Package render formats and writes generated Go code.
|
Package render formats and writes generated Go code. |
|
Package rust generates Rust code using text templates.
|
Package rust generates Rust code using text templates. |
|
Package sql generates SQL schema definitions from a database catalog.
|
Package sql generates SQL schema definitions from a database catalog. |
|
Package typescript generates TypeScript code using text templates.
|
Package typescript generates TypeScript code using text templates. |
Click to show internal directories.
Click to hide internal directories.