sqlstore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 14 Imported by: 6 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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