fathom: github.com/usefathom/fathom/pkg/datastore/sqlstore Index | Files

package sqlstore

import "github.com/usefathom/fathom/pkg/datastore/sqlstore"


Package Files

config.go hostnames.go page_stats.go pageviews.go pathnames.go referrer_stats.go site_stats.go sites.go sqlstore.go users.go


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

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


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

ErrNoResults is returned when a query yielded 0 results

func New Uses

func New(c *Config) *sqlstore

New creates a new database pool

type Config Uses

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 Uses

func (c *Config) DSN() string

func (*Config) Dbname Uses

func (c *Config) Dbname() string

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

Package sqlstore imports 14 packages (graph) and is imported by 2 packages. Updated 2019-02-28. Refresh now. Tools for package owners.