dialect

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(matcher Matcher, config Connector, isDefault bool)

Types

type Config

type Config struct {
	Dialects map[string]interface{} `mapstructure:",remain"`
	Dialect  Matcher
}

type Connector

type Connector interface {
	Connect(useAdmin bool) (*sql.DB, error)
	DatabaseName() string
	Username() string
	Password() string
	Type() string
}

type Dialect

type Dialect struct {
	Matcher   Matcher
	Config    Connector
	IsDefault bool
}

func SelectByConfig

func SelectByConfig(config map[string]interface{}) *Dialect

type Matcher

type Matcher interface {
	MatchName(string) bool
	Decode([]interface{}) (Connector, error)
}

Jump to

Keyboard shortcuts

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