postgres

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 17 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) 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) 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

Jump to

Keyboard shortcuts

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