sqlite

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONRaw

type JSONRaw json.RawMessage

JSONRaw handles SQLite TEXT ↔ json.RawMessage. json.RawMessage's built-in Scanner only handles []byte, not string.

func (*JSONRaw) Scan

func (j *JSONRaw) Scan(src any) error

func (JSONRaw) Value

func (j JSONRaw) Value() (driver.Value, error)

type NullTimestamp

type NullTimestamp struct {
	Time  time.Time
	Valid bool
}

NullTimestamp handles nullable SQLite TEXT timestamp ↔ Go *time.Time.

func (*NullTimestamp) Scan

func (t *NullTimestamp) Scan(src any) error

func (NullTimestamp) TimePtr

func (t NullTimestamp) TimePtr() *time.Time

func (NullTimestamp) Value

func (t NullTimestamp) Value() (driver.Value, error)

type SQLiteBool

type SQLiteBool bool

SQLiteBool handles SQLite INTEGER (0/1) ↔ Go bool conversion.

func (*SQLiteBool) Scan

func (b *SQLiteBool) Scan(src any) error

func (SQLiteBool) Value

func (b SQLiteBool) Value() (driver.Value, error)

type Store

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

func New

func New(path string) (*Store, error)

New opens (or creates) a SQLite database and runs migrations. For file-backed databases, pass a path like "./taskflow.db". For in-memory databases (testing), pass ":memory:".

func (*Store) ActorGet

func (s *Store) ActorGet(ctx context.Context, name string) (model.Actor, error)

func (*Store) ActorGetByAPIKeyHash

func (s *Store) ActorGetByAPIKeyHash(ctx context.Context, hash string) (model.Actor, error)

func (*Store) ActorInsert

func (s *Store) ActorInsert(ctx context.Context, tx repo.Tx, actor model.Actor) (model.Actor, error)

func (*Store) ActorList

func (s *Store) ActorList(ctx context.Context) ([]model.Actor, error)

func (*Store) ActorUpdate

func (s *Store) ActorUpdate(ctx context.Context, tx repo.Tx, params model.UpdateActorParams) (model.Actor, error)

func (*Store) ActorUpdateKeyHash

func (s *Store) ActorUpdateKeyHash(ctx context.Context, name, newHash string) error

func (*Store) AttachmentDelete

func (s *Store) AttachmentDelete(ctx context.Context, tx repo.Tx, id int) error

func (*Store) AttachmentGet

func (s *Store) AttachmentGet(ctx context.Context, id int) (model.Attachment, error)

func (*Store) AttachmentInsert

func (s *Store) AttachmentInsert(ctx context.Context, tx repo.Tx, att model.Attachment) (model.Attachment, error)

func (*Store) AttachmentList

func (s *Store) AttachmentList(ctx context.Context, boardSlug string, taskNum int) ([]model.Attachment, error)

func (*Store) AttachmentUpdateTaskRef

func (s *Store) AttachmentUpdateTaskRef(ctx context.Context, tx repo.Tx, oldBoard string, oldNum int, newBoard string, newNum int) error

func (*Store) AuditInsert

func (s *Store) AuditInsert(ctx context.Context, tx repo.Tx, entry model.AuditEntry) error

func (*Store) AuditQueryByBoard

func (s *Store) AuditQueryByBoard(ctx context.Context, boardSlug string) ([]model.AuditEntry, error)

func (*Store) AuditQueryByTask

func (s *Store) AuditQueryByTask(ctx context.Context, boardSlug string, taskNum int) ([]model.AuditEntry, error)

func (*Store) AuditUpdateTaskRef

func (s *Store) AuditUpdateTaskRef(ctx context.Context, tx repo.Tx, oldBoard string, oldNum int, newBoard string, newNum int) error

func (*Store) BoardAllocateTaskNum

func (s *Store) BoardAllocateTaskNum(ctx context.Context, tx repo.Tx, slug string) (int, error)

func (*Store) BoardGet

func (s *Store) BoardGet(ctx context.Context, slug string) (model.Board, error)

func (*Store) BoardInsert

func (s *Store) BoardInsert(ctx context.Context, tx repo.Tx, board model.Board) (model.Board, error)

func (*Store) BoardList

func (s *Store) BoardList(ctx context.Context, params model.ListBoardsParams) ([]model.Board, error)

func (*Store) BoardSetDeleted

func (s *Store) BoardSetDeleted(ctx context.Context, tx repo.Tx, slug string) error

func (*Store) BoardSetWorkflow

func (s *Store) BoardSetWorkflow(ctx context.Context, tx repo.Tx, slug string, wf json.RawMessage) error

func (*Store) BoardUpdate

func (s *Store) BoardUpdate(ctx context.Context, tx repo.Tx, params model.UpdateBoardParams) (model.Board, error)

func (*Store) BoardUpdateNextTaskNum

func (s *Store) BoardUpdateNextTaskNum(ctx context.Context, tx repo.Tx, slug string, nextNum int) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) CommentGet

func (s *Store) CommentGet(ctx context.Context, id int) (model.Comment, error)

func (*Store) CommentInsert

func (s *Store) CommentInsert(ctx context.Context, tx repo.Tx, comment model.Comment) (model.Comment, error)

func (*Store) CommentList

func (s *Store) CommentList(ctx context.Context, boardSlug string, taskNum int) ([]model.Comment, error)

func (*Store) CommentUpdateBody

func (s *Store) CommentUpdateBody(ctx context.Context, tx repo.Tx, id int, body string) (model.Comment, error)

func (*Store) CommentUpdateTaskRef

func (s *Store) CommentUpdateTaskRef(ctx context.Context, tx repo.Tx, oldBoard string, oldNum int, newBoard string, newNum int) error

func (*Store) DependencyDelete

func (s *Store) DependencyDelete(ctx context.Context, tx repo.Tx, id int) error

func (*Store) DependencyGet

func (s *Store) DependencyGet(ctx context.Context, id int) (model.Dependency, error)

func (*Store) DependencyInsert

func (s *Store) DependencyInsert(ctx context.Context, tx repo.Tx, dep model.Dependency) (model.Dependency, error)

func (*Store) DependencyList

func (s *Store) DependencyList(ctx context.Context, boardSlug string, taskNum int) ([]model.Dependency, error)

func (*Store) DependencyUpdateTaskRefs

func (s *Store) DependencyUpdateTaskRefs(ctx context.Context, tx repo.Tx, oldBoard string, oldNum int, newBoard string, newNum int) error

func (*Store) InTransaction

func (s *Store) InTransaction(ctx context.Context, fn func(tx repo.Tx) error) error

func (*Store) TaskDeleteByBoardAndNums

func (s *Store) TaskDeleteByBoardAndNums(ctx context.Context, tx repo.Tx, boardSlug string, nums []int) error

func (*Store) TaskGet

func (s *Store) TaskGet(ctx context.Context, boardSlug string, num int) (model.Task, error)

func (*Store) TaskInsert

func (s *Store) TaskInsert(ctx context.Context, tx repo.Tx, task model.Task) (model.Task, error)

func (*Store) TaskList

func (s *Store) TaskList(ctx context.Context, filter model.TaskFilter, sort *model.TaskSort) ([]model.Task, error)

func (*Store) TaskListTags

func (s *Store) TaskListTags(ctx context.Context, boardSlug string) ([]model.TagCount, error)

func (*Store) TaskSetDeleted

func (s *Store) TaskSetDeleted(ctx context.Context, tx repo.Tx, boardSlug string, num int) error

func (*Store) TaskUpdate

func (s *Store) TaskUpdate(ctx context.Context, tx repo.Tx, params model.UpdateTaskParams) (model.Task, error)

func (*Store) WebhookDelete

func (s *Store) WebhookDelete(ctx context.Context, tx repo.Tx, id int) error

func (*Store) WebhookDeliveryInsert

func (s *Store) WebhookDeliveryInsert(ctx context.Context, d model.WebhookDelivery) (model.WebhookDelivery, error)

func (*Store) WebhookDeliveryList

func (s *Store) WebhookDeliveryList(ctx context.Context, webhookID int) ([]model.WebhookDelivery, error)

func (*Store) WebhookGet

func (s *Store) WebhookGet(ctx context.Context, id int) (model.Webhook, error)

func (*Store) WebhookInsert

func (s *Store) WebhookInsert(ctx context.Context, tx repo.Tx, webhook model.Webhook) (model.Webhook, error)

func (*Store) WebhookList

func (s *Store) WebhookList(ctx context.Context) ([]model.Webhook, error)

func (*Store) WebhookUpdate

func (s *Store) WebhookUpdate(ctx context.Context, tx repo.Tx, params model.UpdateWebhookParams) (model.Webhook, error)

type StringList

type StringList []string

StringList handles SQLite JSON TEXT ↔ Go []string conversion.

func (*StringList) Scan

func (s *StringList) Scan(src any) error

func (StringList) Value

func (s StringList) Value() (driver.Value, error)

type Timestamp

type Timestamp time.Time

Timestamp handles SQLite TEXT timestamp ↔ Go time.Time conversion. Supports reading multiple formats (RFC3339, millisecond precision, SQLite datetime).

func (*Timestamp) Scan

func (t *Timestamp) Scan(src any) error

func (Timestamp) Time

func (t Timestamp) Time() time.Time

func (Timestamp) Value

func (t Timestamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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