option

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const (
	PresetIDStrategyUndefined        = PresetIDStrategy("undefined")
	PresetIDWithTransientTransaction = PresetIDStrategy("transient")
	PresetIDWithUDFSequence          = PresetIDStrategy("udf")
	PresetIDWithMax                  = PresetIDStrategy("maxid")
)

PresetIDStrategyUndefined and others, represent presetting identities strategies

View Source
const (
	//TagSqlx defines sqlx annotation
	TagSqlx = "sqlx"
)

Variables

This section is empty.

Functions

func Assign

func Assign(options []Option, supplied ...interface{}) bool

Assign assigns supplied option, if returns un assign options and true if assign at least one

Types

type Args

type Args struct {
	// contains filtered or unexported fields
}

Args represents prepare statement arguments

func NewArgs

func NewArgs(args ...interface{}) *Args

NewArgs creates option arguments

func (*Args) StringN

func (a *Args) StringN(n int) ([]string, error)

StringN returns first n option arguments as strings

func (*Args) Unwrap

func (a *Args) Unwrap() []interface{}

Unwrap returns options arguments as interfaces

type BatchSize

type BatchSize int

BatchSize represents a batch size options

type ColumnRestriction

type ColumnRestriction map[string]bool

func (ColumnRestriction) CanUse

func (r ColumnRestriction) CanUse(column string) bool

type Columns

type Columns []string

Columns option to control which column to operate on

func (Columns) Restriction

func (u Columns) Restriction() ColumnRestriction

type Identity

type Identity string

Identity represents identity option

type IdentityOnly

type IdentityOnly bool

IdentityOnly represents identity (pk) only option

type LoadFormat

type LoadFormat string

LoadFormat represents the format of data loaded

type LoadHint

type LoadHint string

LoadHint represents the bigquery.JobConfigurationLoad in json format

type Option

type Option interface{}

Option represents generic option

type Options

type Options []Option

Options represents generic options

func AsOptions

func AsOptions(options []interface{}) Options

AsOptions case slice of interface to Options

func (Options) Args

func (o Options) Args() *Args

Args returns *Args option

func (Options) BatchSize

func (o Options) BatchSize() int

BatchSize returns batch size option

func (Options) Columns

func (o Options) Columns() Columns

Columns returns map of updateable columns

func (Options) Dialect

func (o Options) Dialect() *info.Dialect

Dialect returns dialect

func (Options) Identity

func (o Options) Identity() string

Identity returns identity column

func (Options) IdentityOnly

func (o Options) IdentityOnly() bool

IdentityOnly returns identity only option value or false

func (Options) Interfaces

func (o Options) Interfaces() []interface{}

Interfaces returns current options as interfaces

func (Options) LoadFormat

func (o Options) LoadFormat() string

LoadFormat returns LoadFormat

func (Options) LoadHint

func (o Options) LoadHint() string

LoadHint return LoadHint

func (Options) MaxIDSQLBuilder

func (o Options) MaxIDSQLBuilder() func() *sqlx.SQL

MaxIDSQLBuilder returns function returning SQL which gets max identity value from table

func (Options) PresetIDStrategy

func (o Options) PresetIDStrategy() PresetIDStrategy

PresetIDStrategy returns PresetIDStrategy option

func (Options) Product

func (o Options) Product() *database.Product

Product returns product

func (Options) RecordCount

func (o Options) RecordCount() int64

RecordCount returns record count option

func (Options) SQL

func (o Options) SQL() *sqlx.SQL

SQL returns sqlx.SQL

func (Options) SequenceSQLBuilder

func (o Options) SequenceSQLBuilder() func(*sink.Sequence) (*sqlx.SQL, error)

SequenceSQLBuilder returns sqlx.SQL

func (Options) Tag

func (o Options) Tag() string

Tag returns annotation tag, default sqlx

func (Options) Tx

func (o Options) Tx() *sql.Tx

Tx returns *sql.Tx or nil

type PresetIDStrategy

type PresetIDStrategy string

PresetIDStrategy represents strategy of presetting identities

type RecordCount

type RecordCount int64

RecordCount represents record count option

type Tag

type Tag string

Tag represent a annotation tag name

Jump to

Keyboard shortcuts

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