dbun

package module
v0.0.0-...-c988436 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 0

README

DB Bun

go get -u github.com/rumorshub/dbun

License

Distributed under MIT License, please see license file within the code for more details.

Documentation

Index

Constants

View Source
const PluginName = "db.bun"

Variables

View Source
var ErrDialectNotFound = errors.New("bun sql dialect not found")

Functions

This section is empty.

Types

type BunOpener

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

func NewOpener

func NewOpener(inner SQLDBOpener) *BunOpener

func (*BunOpener) OpenBunDB

func (o *BunOpener) OpenBunDB(name string, opts ...bun.DBOption) (*bun.DB, error)

type Driver

type Driver string
const (
	MySQL      Driver = "mysql"
	SQLiteShim Driver = "sqliteshim"
	Pgx        Driver = "pgx"
	Pg         Driver = "pg"
	AzureSQL   Driver = "azuresql"
	MsSQL      Driver = "mssql"
	SQLServer  Driver = "sqlserver"
)

type Opener

type Opener interface {
	OpenBunDB(name string, opts ...bun.DBOption) (*bun.DB, error)
}

type Plugin

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

func (*Plugin) BunOpener

func (p *Plugin) BunOpener() *BunOpener

func (*Plugin) Init

func (p *Plugin) Init(opener SQLDBOpener) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Provides

func (p *Plugin) Provides() []*dep.Out

type SQLDBOpener

type SQLDBOpener interface {
	OpenDB(name string) (*sql.DB, string, error)
}

Jump to

Keyboard shortcuts

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