rewrite

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 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

Jump to

Keyboard shortcuts

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