mssql

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entity

func Entity(e string, as string) entities

Types

type Compare

type Compare struct {
	Operator string
	Left     Condition
	Right    Condition
}

func Equal

func Equal(left, right Condition) *Compare

func (*Compare) Query

func (c *Compare) Query(ps *Params) string

type Condition

type Condition interface {
	Query(*Params) string
}

type ConditionList

type ConditionList interface {
	Condition
	Append(c ...Condition)
	Len() int
}

func And

func And(c ...Condition) ConditionList

func Or

func Or(c ...Condition) ConditionList

type Contains

type Contains struct {
	Left  Condition
	Right Condition
}

func (*Contains) Query

func (a *Contains) Query(ps *Params) string

type Field

type Field string

func (Field) Query

func (f Field) Query(ps *Params) string

type Insert

type Insert struct {
	Entity entities
	Fields []string
	Values [][]interface{}
	ID     []string
}

func (*Insert) Query

func (i *Insert) Query() (string, []interface{})

type Limit

type Limit struct {
	From int
	To   int
}

func (*Limit) Query

func (l *Limit) Query() string

type MSSQL

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

func New

func New(con string) (*MSSQL, error)

func (*MSSQL) Close

func (p *MSSQL) Close() error

func (*MSSQL) Create

func (p *MSSQL) Create() error

func (*MSSQL) Do

func (p *MSSQL) Do(description string, f func(store.Operation) error) (err error)

func (*MSSQL) Drop

func (p *MSSQL) Drop() error

func (*MSSQL) Ping

func (p *MSSQL) Ping() error

func (*MSSQL) Reset

func (p *MSSQL) Reset() error

type Operation

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

func (*Operation) CreateAuto

func (o *Operation) CreateAuto(auto store.Auto) (store.AutoID, error)

func (*Operation) CreateBar

func (o *Operation) CreateBar(bar store.Bar) (store.BarID, error)

func (*Operation) CreateFoo

func (o *Operation) CreateFoo(foo store.Foo) (store.FooID, error)

func (*Operation) DeleteAuto

func (o *Operation) DeleteAuto(id store.AutoID) error

func (*Operation) DeleteBar

func (o *Operation) DeleteBar(id store.BarID) error

func (*Operation) DeleteFoo

func (o *Operation) DeleteFoo(id store.FooID) error

func (*Operation) GetAuto

func (o *Operation) GetAuto(id store.AutoID) (*store.Auto, error)

func (*Operation) GetBar

func (o *Operation) GetBar(id store.BarID) (*store.Bar, error)

func (*Operation) GetFoo

func (o *Operation) GetFoo(id store.FooID) (*store.Foo, error)

func (*Operation) ImportAutos

func (o *Operation) ImportAutos(entities ...store.Auto) error

func (*Operation) ImportBars

func (o *Operation) ImportBars(entities ...store.Bar) error

func (*Operation) ImportFoos

func (o *Operation) ImportFoos(entities ...store.Foo) error

func (*Operation) SelectAuto

func (o *Operation) SelectAuto() store.AutoSelect

func (*Operation) SelectBar

func (o *Operation) SelectBar() store.BarSelect

func (*Operation) SelectFoo

func (o *Operation) SelectFoo() store.FooSelect

func (*Operation) UpdateAuto

func (o *Operation) UpdateAuto(auto store.Auto) error

func (*Operation) UpdateBar

func (o *Operation) UpdateBar(bar store.Bar) error

func (*Operation) UpdateFoo

func (o *Operation) UpdateFoo(foo store.Foo) error

type Order

type Order map[string]bool

func (Order) Query

func (o Order) Query() string

type Params

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

func (*Params) Append

func (p *Params) Append(v interface{}) int

type Update

type Update struct {
	Entity entities
	Values map[string]interface{}
	Where  Condition
}

func (*Update) Query

func (u *Update) Query() (string, []interface{})

type Value

type Value struct {
	Value interface{}
}

func (*Value) Query

func (v *Value) Query(ps *Params) string

Jump to

Keyboard shortcuts

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