db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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) 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
}

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