db

package
v0.0.0-...-2f40297 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStoragePath

func GetStoragePath() (string, error)

GetStoragePath returns the calculated storage path for the database file. Exported

Types

type TaskDB

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

TaskDB holds the database connection. Exported type.

func OpenDB

func OpenDB() (*TaskDB, error)

OpenDB establishes a connection and ensures the table exists. Exported

func (*TaskDB) Close

func (tdb *TaskDB) Close() error

Close closes the database connection. Exported

func (*TaskDB) Delete

func (tdb *TaskDB) Delete(id uint) error

Delete removes a task by ID.

func (*TaskDB) GetTask

func (tdb *TaskDB) GetTask(id uint) (task.Task, error)

GetTask retrieves a single task by ID.

func (*TaskDB) GetTasks

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

GetTasks retrieves all tasks.

func (*TaskDB) GetTasksByStatus

func (tdb *TaskDB) GetTasksByStatus(status string) ([]task.Task, error)

GetTasksByStatus retrieves tasks filtered by status.

func (*TaskDB) Insert

func (tdb *TaskDB) Insert(name, project string) (task.Task, error)

Insert adds a new task.

func (*TaskDB) Update

func (tdb *TaskDB) Update(id uint, name *string, project *string, status *string) (task.Task, error)

Update modifies an existing task.

Jump to

Keyboard shortcuts

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