internal

package
v0.0.0-...-f88ffbe Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package internal GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var FlagContext = contextx.New[flags.Flag]()

Functions

func BuildStmt

func BuildStmt[M sqlbuilder.Model](ctx context.Context, patchers ...StmtPatcher[M]) sqlfrag.Fragment

func CollectStmt

func CollectStmt[M sqlbuilder.Model](ctx context.Context, patchers ...StmtPatcher[M]) iter.Seq2[string, []any]

func ColumnsByStruct

func ColumnsByStruct(v any) sqlfrag.Fragment

func ToString

func ToString(s sqlfrag.Fragment) string

Types

type Builder

type Builder[M sqlbuilder.Model] struct {
	flags.Flag

	Source     sqlfrag.Fragment
	TableJoins []sqlbuilder.JoinAddition

	Orders []sqlbuilder.Order

	Projects        []sqlfrag.Fragment
	DefaultProjects []sqlfrag.Fragment

	DistinctOn []sqlfrag.Fragment

	Pager sqlbuilder.Addition

	Additions []sqlbuilder.Addition
}

func ApplyStmt

func ApplyStmt[M sqlbuilder.Model](ctx context.Context, b *Builder[M], patchers ...StmtPatcher[M]) *Builder[M]

func (*Builder[M]) ApplyPatchers

func (s *Builder[M]) ApplyPatchers(ctx context.Context, patchers ...StmtPatcher[M]) *Builder[M]

func (*Builder[M]) BuildStmt

func (s *Builder[M]) BuildStmt(ctx context.Context) sqlfrag.Fragment

func (*Builder[M]) PatchWhere

func (s *Builder[M]) PatchWhere(ctx context.Context, where sqlfrag.Fragment) sqlfrag.Fragment

func (*Builder[M]) RuntimeDoc

func (v *Builder[M]) RuntimeDoc(names ...string) ([]string, bool)

func (*Builder[M]) T

func (s *Builder[M]) T(ctx context.Context, m any) sqlbuilder.Table

func (Builder[M]) WithAdditions

func (s Builder[M]) WithAdditions(additions ...sqlbuilder.Addition) *Builder[M]

func (Builder[M]) WithDefaultProjects

func (s Builder[M]) WithDefaultProjects(projects ...sqlfrag.Fragment) *Builder[M]

func (Builder[M]) WithDistinctOn

func (s Builder[M]) WithDistinctOn(on ...sqlfrag.Fragment) *Builder[M]

func (Builder[M]) WithFlag

func (s Builder[M]) WithFlag(f flags.Flag) *Builder[M]

func (Builder[M]) WithOrders

func (s Builder[M]) WithOrders(orders ...sqlbuilder.Order) *Builder[M]

func (Builder[M]) WithPager

func (s Builder[M]) WithPager(pager sqlbuilder.Addition) *Builder[M]

func (Builder[M]) WithProjects

func (s Builder[M]) WithProjects(projects ...sqlfrag.Fragment) *Builder[M]

func (Builder[M]) WithSource

func (s Builder[M]) WithSource(table sqlfrag.Fragment) *Builder[M]

func (Builder[M]) WithTableJoins

func (s Builder[M]) WithTableJoins(tableJoins ...sqlbuilder.JoinAddition) *Builder[M]

type DeleteType

type DeleteType uint
const (
	DeleteTypeNone DeleteType = iota
	DeleteTypeHard
	DeleteTypeSoft
)

func (*DeleteType) RuntimeDoc

func (*DeleteType) RuntimeDoc(names ...string) ([]string, bool)

type Mutation

type Mutation[M sqlbuilder.Model] struct {
	ForDelete DeleteType
	ForUpdate bool
	OmitZero  bool

	From            any
	StrictColumns   []modelscoped.Column[M]
	OmitZeroExclude []modelscoped.Column[M]
	Assignments     []sqlbuilder.Assignment
	Values          iter.Seq[*M]
}

func (*Mutation[M]) Frag

func (m *Mutation[M]) Frag(ctx context.Context) iter.Seq2[string, []any]

func (*Mutation[M]) IsNil

func (m *Mutation[M]) IsNil() bool

func (*Mutation[M]) PrepareAssignments

func (m *Mutation[M]) PrepareAssignments(ctx context.Context, t sqlbuilder.Table) iter.Seq[sqlbuilder.Assignment]

func (*Mutation[M]) PrepareColumnCollectionForInsert

func (m *Mutation[M]) PrepareColumnCollectionForInsert(t sqlbuilder.Table) sqlbuilder.ColumnCollection

func (*Mutation[M]) RuntimeDoc

func (v *Mutation[M]) RuntimeDoc(names ...string) ([]string, bool)

func (Mutation[M]) WithAssignments

func (m Mutation[M]) WithAssignments(assignments ...sqlbuilder.Assignment) *Mutation[M]

type Operator

type Operator[I any, O any] interface {
	Next(i I) O
}

type Seed

type Seed struct {
	flags.Flag
}

func (Seed) GetFlag

func (s Seed) GetFlag(ctx context.Context) flags.Flag

func (*Seed) RuntimeDoc

func (v *Seed) RuntimeDoc(names ...string) ([]string, bool)

type StmtCreator

type StmtCreator interface {
	BuildStmt(ctx context.Context) sqlfrag.Fragment
}

type StmtPatcher

type StmtPatcher[M sqlbuilder.Model] interface {
	ApplyStmt(context.Context, *Builder[M]) *Builder[M]
}

type StmtPatcherFunc

type StmtPatcherFunc[M sqlbuilder.Model] func(context.Context, *Builder[M]) *Builder[M]

func (StmtPatcherFunc[M]) ApplyStmt

func (fn StmtPatcherFunc[M]) ApplyStmt(ctx context.Context, b *Builder[M]) *Builder[M]

func (*StmtPatcherFunc[M]) RuntimeDoc

func (*StmtPatcherFunc[M]) RuntimeDoc(names ...string) ([]string, bool)

type WithFlag

type WithFlag interface {
	GetFlag(ctx context.Context) flags.Flag
}

Directories

Path Synopsis
Package flags GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package flags GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Jump to

Keyboard shortcuts

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