mysql

package module
v0.0.0-...-d28ece7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCharset   = `utf8mb4`
	DefaultCollation = `utf8mb4_bin`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect struct {
	Charset   string
	Collation string

	// NullSafeEqual may be set to true to indicate the availability of the "<=>" operator (null-safe equal to,
	// also known as the spaceship operator).
	NullSafeEqual bool
	// contains filtered or unexported fields
}

func (*Dialect) InsertRows

func (x *Dialect) InsertRows(args *export.InsertRows) (*export.Snippet, error)

func (*Dialect) SelectBatch

func (x *Dialect) SelectBatch(args *export.SelectBatch) (*export.Snippet, error)

func (*Dialect) SelectRows

func (x *Dialect) SelectRows(args *export.SelectRows) (*export.Snippet, error)

type Parser

type Parser struct {
	Dialect *Dialect

	// Parser is optional, note they aren't thread safe.
	Parser *parser.Parser
	// contains filtered or unexported fields
}

func (Parser) ParseTemplate

func (x Parser) ParseTemplate(query string) (*export.Template, error)

ParseTemplate build an export template by parsing a query string. Selected fields must be all primary keys, one for each joined table, potentially more than one per table (multiple joins, note that composite keys are unsupported). Selected fields must be like "SELECT alias.pk as alias". If provided, ORDER BY must specify primary keys only, at most once per key (per join), and only in ascending order. An arbitrary WHERE may be provided, which will be combined (using AND) into the batch select.

Jump to

Keyboard shortcuts

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