gormseries

package module
v0.0.0-...-fa11449 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2016 License: MIT Imports: 3 Imported by: 2

README

gormseries

A timeseries extension for the Go ORM known as Gorm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SeriesDB

type SeriesDB struct {
	gorm.DB
	// contains filtered or unexported fields
}

func NewSeriesDB

func NewSeriesDB(db gorm.DB) *SeriesDB

func (*SeriesDB) BuildScope

func (sdb *SeriesDB) BuildScope() *gorm.DB

func (*SeriesDB) TimeSeries

func (sdb *SeriesDB) TimeSeries(series SeriesRange, args ...interface{}) *gorm.DB

args:

  1. No args .... default value: date_trunc('{time_unit}', created_at) = day
  2. Simple On Clause ex 'day = created_at'

type SeriesRange

type SeriesRange interface {
	StartDate() string
	EndDate() string
	StepInterval() string
	StepName() string
	DefaultJoinCond() string
}
var (
	DaysYear   SeriesRange = new(daysYear)
	MonthsYear SeriesRange = new(monthsYear)
)

Jump to

Keyboard shortcuts

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