db

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateFilterableView added in v0.3.0

func DateFilterableView(view string) bool

DateFilterableView reports whether --on/--from/--to apply to the view.

func FindDBPath

func FindDBPath() (string, error)

FindDBPath locates the Things3 SQLite database.

func ValidView

func ValidView(name string) bool

Types

type AmbiguousTaskError

type AmbiguousTaskError struct {
	Query   string
	Matches []model.Task
}

func (*AmbiguousTaskError) Error

func (e *AmbiguousTaskError) Error() string

type DB

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

func NewFromSQL

func NewFromSQL(sqlDB *sql.DB) *DB

NewFromSQL wraps an existing *sql.DB. Test-only; production code uses Open.

func Open

func Open(path string) (*DB, error)

Open opens a read-only connection to the Things3 database.

func (*DB) Close

func (d *DB) Close() error

func (*DB) FindAreaUUID added in v0.2.0

func (d *DB) FindAreaUUID(ref string) (string, error)

FindAreaUUID resolves an area reference (UUID or title) to its UUID, returning "" when no row matches.

func (*DB) FindTagUUID added in v0.2.0

func (d *DB) FindTagUUID(ref string) (string, error)

FindTagUUID resolves a tag reference (UUID or title) to its UUID, returning "" when no row matches.

func (*DB) FindTasksByTitle

func (d *DB) FindTasksByTitle(substr string) ([]model.Task, error)

func (*DB) GetAuthToken

func (d *DB) GetAuthToken() (string, error)

func (*DB) GetChecklistItems

func (d *DB) GetChecklistItems(taskUUID string) ([]model.ChecklistItem, error)

func (*DB) GetTask

func (d *DB) GetTask(uuidOrTitle string) (*model.Task, error)

func (*DB) GetTaskByUUID

func (d *DB) GetTaskByUUID(uuid string) (*model.Task, error)

func (*DB) ListAreas

func (d *DB) ListAreas() ([]model.Area, error)

func (*DB) ListProjects

func (d *DB) ListProjects(areaFilter string, includeCompleted bool) ([]model.Project, error)

func (*DB) ListTags

func (d *DB) ListTags() ([]model.Tag, error)

func (*DB) ListTasks

func (d *DB) ListTasks(view string, opts TaskFilter) ([]model.Task, error)

func (*DB) SearchTasks

func (d *DB) SearchTasks(query string) ([]model.Task, error)

type TaskFilter

type TaskFilter struct {
	Project string
	Area    string
	Tag     string

	On   *model.ThingsDate
	From *model.ThingsDate
	To   *model.ThingsDate
}

Directories

Path Synopsis
Package dbtest provides helpers for tests that need a Things3-shaped SQLite.
Package dbtest provides helpers for tests that need a Things3-shaped SQLite.

Jump to

Keyboard shortcuts

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