dbi

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostgreZeroTime = "0001-01-01 00:00:00"
	MysqlZeroTime   = "0000-00-00 00:00:00"
)
View Source
const (
	PostgreNotDeleted = ColumnDeletedAt + " = '" + PostgreZeroTime + "'"
	MysqlNotDeleted   = ColumnDeletedAt + " = '" + MysqlZeroTime + "'"
)
View Source
const (
	ColumnDeletedAt = "deleted_at"
)

Variables

This section is empty.

Functions

func ConvertParams

func ConvertParams(v interface{}, escaper string) string

func Insert

func Insert(values interface{}, field ...string) (string, []interface{})

func TableName

func TableName(name string, id uint64) string

Types

type Deleted

type Deleted struct {
	DeleteAt, Time string
}

func DeletedAt

func DeletedAt(t string) *Deleted

type Expression

type Expression struct {
	Field  string        `json:"field"`
	Method Method        `json:"method"`
	Value  []interface{} `json:"value"`
}

type Exprs

type Exprs []Expression

func (Exprs) Build

func (f Exprs) Build() string

func (Exprs) BuildORM

func (f Exprs) BuildORM(odb *gorm.DB) *gorm.DB

func (Exprs) BuildSQL

func (f Exprs) BuildSQL() (string, []interface{})

type Filter

type Filter struct {
	Field  string `json:"field"`
	Method string `json:"method"`
	Value  string `json:"value"`
}

type Filters

type Filters []Filter

func (Filters) Build

func (f Filters) Build() string

func (Filters) BuildORM

func (f Filters) BuildORM(odb *gorm.DB) *gorm.DB

type Method

type Method int
const (
	Equal Method = iota
	NotEqual
	Greater
	Less
	Between
	GreaterOrEqual
	LessOrEqual
	IsNotNull
	IsNull
	In
	NotIn
)

func (Method) Sql

func (m Method) Sql() string

func (Method) String

func (m Method) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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