database

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MSSqlSettings

type MSSqlSettings struct {
	Host     string
	User     string
	Password string
	Name     *string
	AppName  string
}

MSSqlSettings is the settings for a ms sql database

func (*MSSqlSettings) GetDB

func (ds *MSSqlSettings) GetDB() (*sql.DB, error)

GetDB will return a database instance from the settings

func (*MSSqlSettings) WaitForDatabaseToBeOnline

func (ds *MSSqlSettings) WaitForDatabaseToBeOnline(secondsToWait int) error

WaitForDatabaseToBeOnline will wait for the database server to be online for the given seconds.

type PostgresDatabaseSettings

type PostgresDatabaseSettings struct {
	Host     string
	User     string
	Password string
	Name     string
}

PostgresDatabaseSettings are the settings for a timescale database

func (*PostgresDatabaseSettings) EnsureDatabaseExistsAndGetConnection

func (ds *PostgresDatabaseSettings) EnsureDatabaseExistsAndGetConnection() (*sql.DB, error)

EnsureDatabaseExistsAndGetConnection will create the database if it doesn't exist and return a connection.

func (*PostgresDatabaseSettings) MigrateUpWithStatik

func (ds *PostgresDatabaseSettings) MigrateUpWithStatik(subdirectory string) error

MigrateUpWithStatik migrates the database using statik

func (*PostgresDatabaseSettings) WaitForDatabaseToBeOnline

func (ds *PostgresDatabaseSettings) WaitForDatabaseToBeOnline(secondsToWait int) error

WaitForDatabaseToBeOnline will wait for the database server to be online for the given seconds.

Jump to

Keyboard shortcuts

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