option

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 12 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) Db added in v0.7.0

func (o Options) Db() *sql.DB

Db returns *sql.Db or nil

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() 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) SetMarker added in v0.7.0

func (o Options) SetMarker() *SetMarker

SetMarker returns SetMarker option value or false

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 RecordCount

type RecordCount int64

RecordCount represents record count option

type SetMarker added in v0.7.0

type SetMarker struct {
	*structology.Marker
	IdentityIndex int
}

func (*SetMarker) Placeholders added in v0.7.0

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

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