option

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

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) Size added in v0.3.0

func (a *Args) Size() int

Size returns arguments size

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) PresenceProvider added in v0.4.0

func (o Options) PresenceProvider() *PresenceProvider

PresenceProvider returns PresenceProvider option value or false

func (Options) PresetIDStrategy

func (o Options) PresetIDStrategy() dialect.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 PresenceProvider added in v0.4.0

type PresenceProvider struct {
	Holder        *xunsafe.Field
	Fields        []*xunsafe.Field
	IdentityIndex int
}

func (*PresenceProvider) Has added in v0.4.0

func (p *PresenceProvider) Has(ptr unsafe.Pointer, index int) bool

Has returns true if value on holder field with index has been set

func (*PresenceProvider) Init added in v0.4.0

func (p *PresenceProvider) Init(filedPos map[string]int) error

func (*PresenceProvider) IsFieldSet added in v0.5.1

func (p *PresenceProvider) IsFieldSet(ptr unsafe.Pointer, index int) bool

IsFieldSet returns true if field has been set

func (*PresenceProvider) Placeholders added in v0.4.0

func (p *PresenceProvider) Placeholders(record interface{}, placeholders []interface{}) []interface{}

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