database

package
v0.0.0-...-c70c6bf Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Build() (string, map[string]any)
}

type CondAdder

type CondAdder interface {
	AddCond(k string, op string, v any)
}

type CreateTableStatement

type CreateTableStatement struct {
	Table string `db:"Table"`
	DDL   string `db:"Create Table"`
}

type DB

type DB struct {
	*sqlx.DB
}

func MustGet

func MustGet(s string) *DB

func (*DB) Columns

func (db *DB) Columns(t string) []string

func (*DB) Count

func (db *DB) Count(t string) int

func (*DB) CreateStatement

func (db *DB) CreateStatement(t string) CreateTableStatement

func (*DB) Drop

func (db *DB) Drop(t string) bool

func (*DB) Exist

func (db *DB) Exist(t string) bool

func (*DB) Rename

func (db *DB) Rename(s, t string) bool

func (*DB) Run

func (db *DB) Run(q string, arg map[string]any) int64

func (*DB) Tables

func (db *DB) Tables(p string) []string

type DBColumn

type DBColumn struct {
	Field   string  `db:"Field"`
	Type    string  `db:"Type"`
	Null    string  `db:"Null"`
	Key     string  `db:"Key"`
	Default *string `db:"Default"`
	Extra   string  `db:"Extra"`
}

type DBConfig

type DBConfig struct {
	// contains filtered or unexported fields
}

func (*DBConfig) Config

func (c *DBConfig) Config(s string) *mysql.Config

type DqlBuilder

type DqlBuilder struct {
	// contains filtered or unexported fields
}

func NewDqlBuilder

func NewDqlBuilder() *DqlBuilder

func (*DqlBuilder) AddColumn

func (b *DqlBuilder) AddColumn(c ...string)

func (*DqlBuilder) AddCond

func (b *DqlBuilder) AddCond(k string, op string, v any)

func (*DqlBuilder) AddGroup

func (b *DqlBuilder) AddGroup(g ...string)

func (*DqlBuilder) AddHaving

func (b *DqlBuilder) AddHaving(h ...string)

func (*DqlBuilder) AddJoin

func (b *DqlBuilder) AddJoin(j string)

func (*DqlBuilder) AddOrder

func (b *DqlBuilder) AddOrder(k string, o string)

func (*DqlBuilder) Build

func (b *DqlBuilder) Build() (string, DqlBuilderArg)

func (*DqlBuilder) Limit

func (b *DqlBuilder) Limit(l int)

func (*DqlBuilder) Named

func (b *DqlBuilder) Named(n bool)

func (*DqlBuilder) Offset

func (b *DqlBuilder) Offset(o int)

func (*DqlBuilder) Table

func (b *DqlBuilder) Table(t string)

type DqlBuilderArg

type DqlBuilderArg struct {
	// contains filtered or unexported fields
}

type MysqlDB

type MysqlDB struct {
	// contains filtered or unexported fields
}

type QueryBuilder

type QueryBuilder interface {
	TableSetter
	CondAdder
	Setter
	Updater
	Builder
}

func NewQueryBuilder

func NewQueryBuilder(op string) QueryBuilder

type Setter

type Setter interface {
	AddSet(k string, v any)
}

type TableSetter

type TableSetter interface {
	Table(t string)
}

type Updater

type Updater interface {
	AddUpdate(k string, v any)
}

Jump to

Keyboard shortcuts

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