db

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 8 Imported by: 0

README

db

sqlx wrapper for mysql

read

  1. List

    db.NewRead().List(query, args)

  2. ListNamed

    db.NewRead().ListNamed(query, args)

  3. ListStruct

  4. ListStructNamed

  5. Item

    db.NewRead().Item(query, args)

  6. ItemNamed

    db.NewRead().ItemNamed(query, args)

  7. ItemStruct

    db.NewRead().ItemStruct(dest, query, args)

  8. ItemStructNamed

    db.NewRead().ItemStructNamed(dest, query, args)

write

  1. List

    db.NewWrite().List(query, args)

  2. ListNamed

    db.NewWrite().List(query, args)

  3. Item

    db.NewWrite().Item(query, args)

  4. ItemNamed

    db.NewWrite().ItemNamed(query, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v1.1.6

func New(Driver, Source string)

Types

type Read

type Read struct{}

Read Read

func NewRead

func NewRead() *Read

NewRead new read

func (*Read) Item

func (r *Read) Item(query string, args ...interface{}) (*sqlx.Row, error)

Item read item

func (*Read) ItemNamed

func (r *Read) ItemNamed(query string, args interface{}) (*sqlx.Row, error)

ItemNamed read item named

func (*Read) ItemStruct

func (r *Read) ItemStruct(dest interface{}, query string, args ...interface{}) error

ItemStruct read item struct

func (*Read) ItemStructNamed

func (r *Read) ItemStructNamed(dest interface{}, query string, args interface{}) error

ItemStructNamed item struct named

func (*Read) List

func (r *Read) List(query string, args ...interface{}) (*sqlx.Rows, error)

List read list

func (*Read) ListNamed

func (r *Read) ListNamed(query string, args interface{}) (*sqlx.Rows, error)

ListNamed read list named

func (*Read) ListStruct

func (r *Read) ListStruct(dest interface{}, query string, args ...interface{}) error

ListStruct read list struct

func (*Read) ListStructNamed

func (r *Read) ListStructNamed(dest interface{}, query string, args interface{}) error

ListStructNamed list struct named

type Write

type Write struct{}

Write write

func NewWrite

func NewWrite() *Write

NewWrite new *Write

func (*Write) Item

func (w *Write) Item(query string, args ...interface{}) (sql.Result, error)

Item write

func (*Write) ItemNamed

func (w *Write) ItemNamed(query string, args interface{}) (sql.Result, error)

ItemNamed wirte item named

func (*Write) List

func (w *Write) List(query string, args ...[]interface{}) (sql.Result, error)

List write list

func (*Write) ListNamed

func (w *Write) ListNamed(query string, args ...interface{}) (sql.Result, error)

ListNamed write list named

Jump to

Keyboard shortcuts

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