Help us shape the future of Go! Take the 2026 Go Developer Survey

rewrite

package
v1.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamedParameters

func NamedParameters(engine config.Engine, raw *ast.RawStmt, numbs map[int]bool, dollar bool) (*ast.RawStmt, *named.ParamSet, []source.Edit)

Types

type Embed

type Embed struct {
	Table *ast.TableName

	Node *ast.ColumnRef
	// contains filtered or unexported fields
}

Embed is an instance of `sqlc.embed(param)`

func (Embed) Orig

func (e Embed) Orig() string

Orig string to replace

type EmbedSet

type EmbedSet []*Embed

EmbedSet is a set of Embed instances

func Embeds

func Embeds(raw *ast.RawStmt) (*ast.RawStmt, EmbedSet)

Embeds rewrites `sqlc.embed(param)` to a `ast.ColumnRef` of form `param.*`. The compiler can make use of the returned `EmbedSet` while expanding the `param.*` column refs to produce the correct source edits.

func (EmbedSet) Find

func (es EmbedSet) Find(node *ast.ColumnRef) (*Embed, bool)

Find a matching embed by column ref

type Relation

type Relation struct {
	Name string
	Node *ast.A_Const
}

Relation is an instance of `sqlc.relation(query)`

func (Relation) Orig

func (r Relation) Orig() string

Orig string to replace

type RelationSet

type RelationSet []*Relation

RelationSet is a set of Relation instances

func Relations

func Relations(raw *ast.RawStmt) (*ast.RawStmt, RelationSet, []source.Edit)

Relations rewrites `sqlc.relation(query)` to a `ast.A_Const` of value `NULL`. The compiler can make use of the returned `RelationSet` and edits.

func (RelationSet) Find

func (rs RelationSet) Find(node *ast.A_Const) (*Relation, bool)

Find a matching relation by node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL