sqlstore

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MYSQL    = "mysql"
	POSTGRES = "postgres"
	SQLITE   = "sqlite3"

	DATE_FORMAT = "2006-01-02 15:00:00"
)

Variables

View Source
var ErrNoResults = errors.New("datastore: query returned 0 results")

ErrNoResults is returned when a query yielded 0 results

Functions

func New

func New(c *Config) *sqlstore

New creates a new database pool

Types

type Config

type Config struct {
	Driver   string `default:"sqlite3"`
	URL      string `default:""`
	Host     string `default:""`
	User     string `default:""`
	Password string `default:""`
	Name     string `default:"fathom.db"`
	SSLMode  string `default:""`
}

func (*Config) DSN

func (c *Config) DSN() string

func (*Config) Dbname

func (c *Config) Dbname() string

Dbname returns the database name, either from config values or from the connection URL

Jump to

Keyboard shortcuts

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