dbutil

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWhereClause added in v0.26.0

func BuildWhereClause(filters ...string) string

func GetDirQuery

func GetDirQuery(dir string) string

func GetMetadataQuery

func GetMetadataQuery(db string, m map[string]interface{}) (mb []byte, mq string, err error)

func GetNameQuery

func GetNameQuery(name string) (string, string)

func GetOffsetLimitQuery added in v0.24.0

func GetOffsetLimitQuery(limit uint64) string

func GetOrderQuery

func GetOrderQuery(order string) string

func Total added in v0.26.0

func Total(ctx context.Context, db Database, query string, params interface{}) (uint64, error)

Types

type Database added in v0.26.0

type Database interface {
	NamedExecContext(context.Context, string, interface{}) (sql.Result, error)
	QueryRowxContext(context.Context, string, ...interface{}) *sqlx.Row
	NamedQueryContext(context.Context, string, interface{}) (*sqlx.Rows, error)
	SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	GetContext(context.Context, interface{}, string, ...interface{}) error
	BeginTxx(context.Context, *sql.TxOptions) (*sqlx.Tx, error)
}

Database provides a database interface

func NewDatabase added in v0.26.0

func NewDatabase(db *sqlx.DB) Database

NewDatabase creates a ThingDatabase instance

Jump to

Keyboard shortcuts

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