driver

package
v0.0.0-...-c9a44e9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driver Driver) error

Types

type Config

type Config struct {
	Protocol string `json:"protocol"`
	Host     string `json:"host"`
	Port     uint64 `json:"port"`
	User     string `json:"user"`
	Role     string `json:"role"` // For PostgreSQL
	Password string `json:"password"`
	Database string `json:"database"`
	Schema   string `json:"schema"` // For PostgreSQL
	Table    string `json:"table"`
	SSLMode  string `json:"sslmode"` // For PostgreSQL
}

type Conn

type Conn interface {
	HasTable() (bool, error)
	CreateTable() error
	GetApplied() ([]string, error)
	AddApplied(string) error
	RemoveApplied(string) error
	Execute(string) error
}

Conn is the interface used by the program to manipulate the database.

type Driver

type Driver interface {
	New(Config) (Conn, error)
}

Driver is the interface used by the program to initialize the database connection.

func Get

func Get(driver string) (Driver, error)

Get returns the requested driver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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