infra

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Drivers = make(map[string]Driver)

Drivers is a registry of drivers

View Source
var ErrClosed = errors.New("infra: connection is closed")

ErrClosed should be returned by Execute if the connection is closed

Functions

func Register

func Register(name string, driver Driver)

Register registers a new driver

Types

type Connection

type Connection interface {
	Execute(ctx context.Context, priority int, sql string, args ...any) (*sqlx.Rows, error)
	Close() error
	InformationSchema() string
}

type Driver

type Driver interface {
	Open(dsn string) (Connection, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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