database

package
v0.0.2-0...-fcdf84f Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(uri string, config Config) (*sql.DB, error)

Types

type Config

type Config struct {
	// The Directory Path of the database migrations.  If this is set,
	// the database will be automatically migrated when generating a
	// new connection.
	MigrationsDir string
}

type ConnectionInfo

type ConnectionInfo struct {
	Host         string
	Port         string
	User         string
	Password     string
	DatabaseName string
	SSLMode      string
}

func (ConnectionInfo) ToURI

func (c ConnectionInfo) ToURI() string

type EphemeralDatabase

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

EphemeralDatabase represents

func NewEphemeralDatabase

func NewEphemeralDatabase(bootstrapConnection ConnectionInfo, config Config) (*EphemeralDatabase, error)

func (*EphemeralDatabase) Connection

func (e *EphemeralDatabase) Connection() *sql.DB

Connection returns a reference to the connection to the ephemeral database

func (*EphemeralDatabase) Terminate

func (e *EphemeralDatabase) Terminate() error

Terminate entirely deletes the ephemeral database, and also closes out the connection.

Jump to

Keyboard shortcuts

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