Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(collapse, encoding bool, dst, src interface{}, columns ...string) error
- func CreateTable(i interface{}, s query.Starter, temporary, ifNotExists bool) string
- func FormatDate(n int) (s string)
- func FromDate(n int) (t time.Time, ok bool)
- func FromUnix(ms int64) time.Time
- func IsDate(n int) bool
- func LimitTime(t time.Time, prec int) time.Time
- func Now(prec int) time.Time
- func NowDate() int
- func NowUnix() int64
- func ParseDate(s string) int
- func ToDate(t time.Time) int
- func ToUnix(t time.Time) int64
- type Column
- type Columns
- type Field
- type Huge
- func (h Huge) Begin() (_ Huge, err error)
- func (h Huge) Close() error
- func (h Huge) Commit() (err error)
- func (h Huge) Create(i interface{}) (interface{}, error)
- func (h Huge) Delete(i interface{}) (interface{}, error)
- func (h Huge) DeleteBy(primaryKeys, row interface{}) (int64, error)
- func (h Huge) Driver() driver.Driver
- func (h Huge) Exec(q query.Expression) (sql.Result, error)
- func (h Huge) Expand(q query.Expression) (string, []interface{}, error)
- func (h Huge) LimitTime(t time.Time) time.Time
- func (h Huge) Load(i interface{}) (interface{}, error)
- func (h Huge) Now() time.Time
- func (h Huge) Ping() error
- func (h Huge) Prepare(q query.Expression) (*sql.Stmt, []interface{}, error)
- func (h Huge) Q(a ...query.Expression) *Rows
- func (h Huge) Query(q query.Expression) *Rows
- func (h Huge) Read(i interface{}, columns ...string) (interface{}, error)
- func (h Huge) ReadBy(primaryKeys, row interface{}, columns ...string) (interface{}, error)
- func (h Huge) Rollback() (err error)
- func (h Huge) SetConnMaxLifetime(d time.Duration)
- func (h Huge) SetMaxIdleConns(n int)
- func (h Huge) SetMaxOpenConns(n int)
- func (h Huge) Stats() sql.DBStats
- func (h Huge) Update(i interface{}, columns ...string) (interface{}, error)
- func (h Huge) UpdateBy(primaryKeys, row interface{}, columns ...string) (int64, error)
- func (h Huge) Upsert(z bool, i interface{}, columns ...string) (ok bool, err error)
- type Kind
- type Querier
- type Rows
- type Struct
- type Table
- func (t *Table) AutoIncrement() *Column
- func (t *Table) AutoNow() *Column
- func (t *Table) AutoNowAdd() *Column
- func (t *Table) CreateTable(s query.Starter, temporary, ifNotExists bool) (string, error)
- func (t *Table) Filter(columns ...string) Columns
- func (t *Table) Find(s string) *Column
- func (t *Table) PrimaryKey() *Column
- func (t *Table) Qualifier(a ...string) query.Operand
- func (t *Table) Rename(s string)
- func (t *Table) Version() *Column
Constants ¶
View Source
const ( Millisecond = 1 Second = 1e3 * Millisecond Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day )
View Source
const Exclude = ""
Variables ¶
View Source
var ( ErrNoRows = sql.ErrNoRows ErrTxDone = sql.ErrTxDone )
Functions ¶
func Convert ¶
Convert T to []interface{} or map[string]interface{}; []T or map[]T to [][]interface{}, []map[string]interface{}, map[PK][]interface{} or map[PK]map[string]interface{}.
func CreateTable ¶
func FormatDate ¶
Types ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) IsEncoding ¶
type Huge ¶
type Huge struct { Starter query.Starter Querier Querier DealName func(string) string TimePrec int }
func (Huge) Delete ¶
Delete T returns bool, []T returns map[int]struct{}, map[]T returns map[]struct{}.
func (Huge) Read ¶
Read *T returns bool, []T returns map[int]struct{}, map[]*T returns map[]struct{}.
func (Huge) ReadBy ¶
ReadBy PK returns *T, []PK returns []*T, map[PK] returns map[PK]*T or []*T only if without PK column.
func (Huge) SetConnMaxLifetime ¶
func (Huge) SetMaxIdleConns ¶
func (Huge) SetMaxOpenConns ¶
func (Huge) Update ¶
Update T returns bool, []T returns map[int]struct{}, map[]T returns map[]struct{}.
type Rows ¶
type Table ¶
func (*Table) AutoIncrement ¶
func (*Table) AutoNowAdd ¶
func (*Table) CreateTable ¶
func (*Table) PrimaryKey ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.