db

package
v0.0.0-...-fdf5f90 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

type D1

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

func NewD1

func NewD1(url url.URL, auther Auth) D1

func (*D1) CreateIndexes

func (dbh *D1) CreateIndexes(ts []db.Index) error

func (*D1) CreateTables

func (dbh *D1) CreateTables(ctx context.Context, ts []db.Table) error

func (*D1) CreateViews

func (dbh *D1) CreateViews(ts []db.View) error

func (*D1) Delete

func (dbh *D1) Delete(table string, conditions []map[string]any) (db.Result, error)

func (*D1) Insert

func (dbh *D1) Insert(ctx context.Context, table string, rows []map[string]string) (db.Result, error)

func (*D1) Select

func (dbh *D1) Select(ctx context.Context, table string, columns func() map[string]any) (db.Result, error)

func (*D1) Update

func (dbh *D1) Update(table string, assignments []map[string]any, conditions []map[string]any) (db.Result, error)

type KeyDB

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

func NewKeyDB

func NewKeyDB(ctx context.Context, opt *redis.Options) (*KeyDB, error)

func (*KeyDB) Close

func (db *KeyDB) Close() error

func (*KeyDB) Delete

func (db *KeyDB) Delete(ctx context.Context, key ...string) error

func (*KeyDB) DeleteAll

func (db *KeyDB) DeleteAll(ctx context.Context) error

func (*KeyDB) Get

func (db *KeyDB) Get(ctx context.Context, key ...string) (map[string][]byte, error)

func (*KeyDB) Head

func (db *KeyDB) Head(ctx context.Context, key ...string) (bool, error)

func (*KeyDB) List

func (db *KeyDB) List(ctx context.Context, prefix *string, limit *uint) (keys []string, cursor uint64, err error)

func (*KeyDB) Put

func (db *KeyDB) Put(ctx context.Context, entries map[string][]byte, ttl time.Duration) error

type MySQL

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

func NewMySQL

func NewMySQL(ctx context.Context, dsn string) (*MySQL, error)

func (*MySQL) Close

func (dbh *MySQL) Close() error

func (*MySQL) CreateIndexes

func (dbh *MySQL) CreateIndexes(context.Context, []db.Index) error

func (*MySQL) CreateTables

func (dbh *MySQL) CreateTables(ctx context.Context, ts []db.Table) error

func (*MySQL) CreateViews

func (dbh *MySQL) CreateViews(ctx context.Context, ts []db.View) error

func (*MySQL) Delete

func (dbh *MySQL) Delete(ctx context.Context, table string, conditions map[string]any) error

func (MySQL) DropTables

func (dbh MySQL) DropTables(ctx context.Context, tables []db.Table) error

func (*MySQL) Insert

func (dbh *MySQL) Insert(ctx context.Context, table string, rows []map[string]any) (db.Result, error)

func (*MySQL) Select

func (dbh *MySQL) Select(ctx context.Context, table string, columns func() map[string]any, where []db.Condition) (res db.Result, err error)

func (*MySQL) Update

func (dbh *MySQL) Update(ctx context.Context, table string, assignments map[string]any, conditions map[string]any) error

Jump to

Keyboard shortcuts

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