xsql

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 15 Imported by: 2

README

data-xsql GoDoc

sql library for Go

Installation

go get gopkg.in/goyy/goyy.v0/data/xsql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPriority

func SetPriority(value int)

SetPriority set the priority of the logger.

Types

type DB

type DB interface {
	Query(dql string, args ...interface{}) Query
	NamedQuery(dql string, args map[string]interface{}) (Query, error)
	Sifter(sifts ...domain.Sift) Sifter

	Get(out entity.Interface) error

	Insert(e entity.Interface) (int64, error)
	Update(e entity.Interface) (int64, error)
	Delete(e entity.Interface) (int64, error)
	Disable(e entity.Interface) (int64, error)

	Exec(dml string, args ...interface{}) (sql.Result, error)

	Begin() (Tx, error)

	Close() error

	Dialect() dialect.Interface

	Ping() error
}

DB xsql.DB.

func New

func New(dialect dialect.Interface, name string) (DB, error)

New DB

func NewDB

func NewDB(name string) (DB, error)

NewDB new DB.

type Query

type Query interface {
	Rows(out entity.Interfaces) error
	Row(out entity.Interface) error
	Int() (int, error)
	Float() (float64, error)
	Str() (string, error)
	Time() (time.Time, error)
	Page(content entity.Interfaces, pageable domain.Pageable) (domain.Page, error)

	String() string
}

Query xsql.Query.

type Sifter

type Sifter interface {
	Rows(out entity.Interfaces) error
	Row(out entity.Interface) error
	Count(e entity.Interface) (int, error)
	Page(content entity.Interfaces, pageable domain.Pageable) (domain.Page, error)
}

Sifter xsql.Sifter.

type Tx

type Tx interface {
	Exec(dml string, args ...interface{}) (sql.Result, error)
	Commit() error
	Rollback() error
}

Tx xsql.Tx.

Jump to

Keyboard shortcuts

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