postgres

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDB

func MigrateDB(ctx context.Context, cfg *config.Migrate) error

Types

type Note

type Note struct {
	ID        string                      `db:"id"         goqu:"skipupdate"`
	Name      string                      `db:"name"`
	Content   types.JSON[service.Content] `db:"content"`
	Path      string                      `db:"path"`
	UpdatedBy types.Null[string]          `db:"updated_by"`
	CreatedAt types.Null[types.Time]      `db:"created_at" goqu:"skipupdate"`
	UpdatedAt types.Null[types.Time]      `db:"updated_at"`
}

type NoteIDName

type NoteIDName struct {
	ID   string `db:"id"`
	Name string `db:"name"`
}

type Postgres

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

func New

func New(ctx context.Context, cfg *config.StorePostgres) (*Postgres, error)

func (*Postgres) Close

func (s *Postgres) Close()

func (*Postgres) Delete

func (s *Postgres) Delete(ctx context.Context, id string) error

func (*Postgres) DeleteProcessBefore added in v0.2.2

func (s *Postgres) DeleteProcessBefore(ctx context.Context, before time.Time) (int64, error)

func (*Postgres) Get

func (s *Postgres) Get(ctx context.Context, id string) (*service.Note, error)

func (*Postgres) GetNotes

func (s *Postgres) GetNotes(ctx context.Context) ([]service.IDName, error)

func (*Postgres) GetProcess added in v0.2.0

func (s *Postgres) GetProcess(ctx context.Context, q *query.Query) ([]service.Process, error)

func (*Postgres) GetWithPath

func (s *Postgres) GetWithPath(ctx context.Context, path string) (*service.Note, error)

func (*Postgres) Save

func (s *Postgres) Save(ctx context.Context, note *service.Note) error

func (*Postgres) SaveProcess added in v0.2.0

func (s *Postgres) SaveProcess(ctx context.Context, process *service.Process) error

type Process added in v0.2.0

type Process struct {
	ID        string                          `db:"id"         goqu:"skipupdate"`
	Status    string                          `db:"status"`
	Info      types.JSON[service.ProcessInfo] `db:"info"`
	User      types.Null[string]              `db:"user"       goqu:"skipupdate"`
	CreatedAt types.Time                      `db:"created_at" goqu:"skipupdate"`
	UpdatedAt types.Time                      `db:"updated_at"`
}

Jump to

Keyboard shortcuts

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