db

package
v0.0.0-...-6d918e5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBPath

func GetDBPath() string

func InitDB

func InitDB(dbPath string) error

InitDB creates a new SQLite database at the provided path with the required schema. It returns an error if the file already exists to avoid overwriting data.

Types

type TaskDB

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

func NewTaskDB

func NewTaskDB(dbPath string) (*TaskDB, error)

func (*TaskDB) ArchiveCompleted

func (t *TaskDB) ArchiveCompleted() (int64, error)

ArchiveCompleted archives all tasks with Done or Canceled state

func (*TaskDB) Close

func (t *TaskDB) Close() error

func (*TaskDB) CreateSchema

func (t *TaskDB) CreateSchema() error

func (*TaskDB) CreateTask

func (t *TaskDB) CreateTask(title string, url string, state string) (int64, error)

func (*TaskDB) DeleteTask

func (t *TaskDB) DeleteTask(id int) error

func (*TaskDB) GetArchivedTasks

func (t *TaskDB) GetArchivedTasks(search, dateExact, dateAfter, dateBefore string) ([]task.Task, error)

GetArchivedTasks returns archived tasks with optional filters

func (*TaskDB) GetTask

func (t *TaskDB) GetTask(id int) (*task.Task, error)

func (*TaskDB) GetTasks

func (t *TaskDB) GetTasks() ([]task.Task, error)

func (*TaskDB) MarkDone

func (t *TaskDB) MarkDone(id int) error

func (*TaskDB) SwapTaskOrder

func (t *TaskDB) SwapTaskOrder(idA int, orderA int, idB int, orderB int) error

func (*TaskDB) UpdateTask

func (t *TaskDB) UpdateTask(id int, title, url, notes, subtasks string, state string) error

Jump to

Keyboard shortcuts

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