sqlite3

package
v0.0.0-...-98c00f4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategorySummaryParams

type CategorySummaryParams struct {
	Category string
	Day      interface{}
}

type CreateIntervalParams

type CreateIntervalParams struct {
	StartTime       time.Time
	PlannedDuration int64
	ActualDuration  int64
	Category        string
	State           int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Interval

type Interval struct {
	ID              int64
	StartTime       time.Time
	PlannedDuration int64
	ActualDuration  int64
	Category        string
	State           int64
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) Breaks

func (q *Queries) Breaks(ctx context.Context, limit int64) ([]Interval, error)

func (*Queries) ByID

func (q *Queries) ByID(ctx context.Context, id int64) (Interval, error)

func (*Queries) CategorySummary

func (q *Queries) CategorySummary(ctx context.Context, arg CategorySummaryParams) (sql.NullFloat64, error)

The strftime() routine returns the date formatted according to the format string specified as the first argument.

func (*Queries) Count

func (q *Queries) Count(ctx context.Context) (int64, error)

func (*Queries) CreateInterval

func (q *Queries) CreateInterval(ctx context.Context, arg CreateIntervalParams) (Interval, error)

func (*Queries) GetIntervals

func (q *Queries) GetIntervals(ctx context.Context) ([]Interval, error)

func (*Queries) Last

func (q *Queries) Last(ctx context.Context) (Interval, error)

func (*Queries) UpdateInterval

func (q *Queries) UpdateInterval(ctx context.Context, arg UpdateIntervalParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UpdateIntervalParams

type UpdateIntervalParams struct {
	StartTime      time.Time
	ActualDuration int64
	State          int64
	ID             int64
}

Jump to

Keyboard shortcuts

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