Documentation ¶
Index ¶
- func CopyFieldsToNewStruct(structType interface{}, object Object) (interface{}, error)
- type DB
- func (dal *DB) Close()
- func (dal DB) Connect() (DB, error)
- func (dal DB) Exec(query string, values ...[]any) (sql.Result, error)
- func (dal DB) Model(options ...any) Model
- func (dal DB) Query(query string, values ...any) ([]Object, error)
- func (dal DB) Tx(ctx context.Context, qFn func(t *sql.Tx) (any, error)) (any, error)
- type DataSource
- type Driver
- type FieldBinding
- type GlueOperator
- type IDB
- type IModel
- type ISerializer
- type Model
- func (m Model) Delete(where Object, or ...bool) (int64, error)
- func (m *Model) Deserialize(os ...Object) (any, error)
- func (m Model) Find(args ...any) (interface{}, error)
- func (m Model) First(where Object, or ...bool) (any, error)
- func (m Model) Insert(data Object) (int64, error)
- func (m Model) InsertBulk(data ...Object) (Object, error)
- func (m Model) Update(where Object, data Object, or ...bool) (int64, error)
- type Object
- type SortOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFieldsToNewStruct ¶ added in v0.1.0
Types ¶
type DB ¶ added in v0.1.0
func NewDB ¶ added in v0.1.0
func NewDB(driver Driver, uri DataSource) DB
type DataSource ¶ added in v0.1.0
type DataSource string
type FieldBinding ¶
type FieldBinding struct { sync.RWMutex // embedded. see http://golang.org/ref/spec#Struct_types FieldArr []interface{} FieldPtrArr []interface{} FieldCount int64 MapFieldToID map[string]int64 }
FieldBinding is deisgned for SQL rows.Scan() query.
func (*FieldBinding) GetFieldArr ¶
func (fb *FieldBinding) GetFieldArr() map[string]interface{}
GetFieldArr ...
func (*FieldBinding) GetFieldPtrArr ¶
func (fb *FieldBinding) GetFieldPtrArr() []interface{}
GetFieldPtrArr ...
type GlueOperator ¶ added in v0.1.0
type GlueOperator string
const ( AND GlueOperator = "AND" OR GlueOperator = "OR" )
type ISerializer ¶ added in v0.1.0
type ISerializer interface {
New() interface{}
}
Click to show internal directories.
Click to hide internal directories.