db

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB(ctx micro.Context, name string) (*sql.DB, error)

Types

type DBExec

type DBExec interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
}

type DBInterface

type DBInterface interface {
	DBExec
	Begin() (DBTransaction, error)
}

func GetDBInterface

func GetDBInterface(ctx micro.Context, name string) (DBInterface, error)

type DBService

type DBService interface {
	micro.Service
	GetDB() *sql.DB
}

type DBTransaction

type DBTransaction interface {
	DBExec
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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