sqlite

package
v0.0.0-...-1b3b427 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB implements storage.Store using SQLite.

func Open

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

Open opens or creates a SQLite database at the given path.

func (*DB) AppendSection

func (d *DB) AppendSection(planID, name, content string) error

AppendSection appends content to an existing section.

func (*DB) Close

func (d *DB) Close() error

Close closes the database.

func (*DB) CreateComment

func (d *DB) CreateComment(c *plan.PlanComment) error

CreateComment inserts a new comment.

func (*DB) CreatePlan

func (d *DB) CreatePlan(p *plan.Plan) error

CreatePlan inserts a new plan.

func (*DB) CreateSnapshot

func (d *DB) CreateSnapshot(planID string, changedBy string, summary string) error

CreateSnapshot creates a JSON snapshot of the current plan state and saves it as a version.

func (*DB) CreateTask

func (d *DB) CreateTask(t *plan.PlanTask) error

CreateTask inserts a new task.

func (*DB) CreateVersion

func (d *DB) CreateVersion(v *plan.PlanVersion) error

CreateVersion inserts a new version snapshot.

func (*DB) DeleteSection

func (d *DB) DeleteSection(planID, name string) error

DeleteSection deletes a section by plan ID and name.

func (*DB) GetNextTaskOrder

func (d *DB) GetNextTaskOrder(planID string) (int, error)

GetNextTaskOrder returns the next task order number for a plan.

func (*DB) GetPlan

func (d *DB) GetPlan(id string) (*plan.Plan, error)

GetPlan retrieves a plan by ID.

func (*DB) GetPlanFull

func (d *DB) GetPlanFull(id string) (*plan.PlanFull, error)

GetPlanFull retrieves a complete plan with sections, tasks, and comments.

func (*DB) GetSection

func (d *DB) GetSection(planID, name string) (*plan.PlanSection, error)

GetSection retrieves a specific section.

func (*DB) GetSections

func (d *DB) GetSections(planID string) ([]plan.PlanSection, error)

GetSections retrieves all sections for a plan.

func (*DB) GetTask

func (d *DB) GetTask(id string) (*plan.PlanTask, error)

GetTask retrieves a task by ID.

func (*DB) GetVersion

func (d *DB) GetVersion(planID string, version int) (*plan.PlanVersion, error)

GetVersion retrieves a specific version.

func (*DB) GetVersions

func (d *DB) GetVersions(planID string) ([]plan.PlanVersion, error)

GetVersions lists all versions for a plan.

func (*DB) ListComments

func (d *DB) ListComments(planID string) ([]plan.PlanComment, error)

ListComments lists all comments for a plan.

func (*DB) ListPlans

func (d *DB) ListPlans(filter storage.PlanFilter) ([]plan.Plan, error)

ListPlans lists plans with optional filtering.

func (*DB) ListTasks

func (d *DB) ListTasks(planID string, filter storage.TaskFilter) ([]plan.PlanTask, error)

ListTasks lists tasks for a plan with optional filtering.

func (*DB) SearchPlans

func (d *DB) SearchPlans(query string) ([]plan.Plan, error)

SearchPlans searches plans by title and section content.

func (*DB) UpdatePlan

func (d *DB) UpdatePlan(p *plan.Plan) error

UpdatePlan updates an existing plan's metadata.

func (*DB) UpdateTask

func (d *DB) UpdateTask(t *plan.PlanTask) error

UpdateTask updates an existing task.

func (*DB) UpsertSection

func (d *DB) UpsertSection(s *plan.PlanSection) error

UpsertSection creates or updates a section.

Jump to

Keyboard shortcuts

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