insert

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string
const (
	// PlaceholderToken is the bind‐marker
	Placeholder = "?"

	// ParameterizedValuesOnly indicates that this INSERT
	// uses placeholders only in its VALUES clause.
	ParameterizedValuesOnly Kind = "ParameterizedValuesOnlyInsert"
)

type Statement

type Statement struct {
	*insert.Statement
	Kind                      Kind
	ValuesOnlyPlaceholdersCnt int
	PlaceholderValue          *insert.Value
}

func NewStatement

func NewStatement(base *insert.Statement) *Statement

NewStatement allocates a Statement with a pre-built placeholder node.

func (*Statement) CloneForValuesOnly

func (s *Statement) CloneForValuesOnly(placeholderCount int) *Statement

CloneForValuesOnly returns a shallow clone prepared for values-only usage. It copies only the top-level struct and fields we’ll change.

func (*Statement) PrepareValuesOnly

func (s *Statement) PrepareValuesOnly(placeholderCount int)

PrepareValuesOnly mutates this Statement to values-only mode. Call this only on a fresh/unshared Statement.

func (*Statement) ValueAt

func (s *Statement) ValueAt(i int) *insert.Value

ValueAt returns either the real literal for index i, or the shared PlaceholderValue if in "values‐only" mode.

func (*Statement) ValuesCnt

func (s *Statement) ValuesCnt() int

ValuesCnt returns the logical row-count: either the literal Values slice length or the placeholder count.

Jump to

Keyboard shortcuts

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