postgres

package
v1.61.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package postgres provides PostgreSQL storage for prompts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements prompt.Store using PostgreSQL.

func New

func New(db *sql.DB) *Store

New creates a new PostgreSQL prompt store.

func (*Store) Count

func (s *Store) Count(ctx context.Context, filter prompt.ListFilter) (int, error)

Count returns the number of prompts matching the filter.

func (*Store) Create

func (s *Store) Create(ctx context.Context, p *prompt.Prompt) error

Create persists a new prompt. If p.ID is empty the database generates one.

func (*Store) Delete

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

Delete removes a prompt by name.

func (*Store) DeleteByID

func (s *Store) DeleteByID(ctx context.Context, id string) error

DeleteByID removes a prompt by ID.

func (*Store) Get

func (s *Store) Get(ctx context.Context, name string) (*prompt.Prompt, error)

Get retrieves a prompt by name. Returns nil, nil if not found.

func (*Store) GetByID

func (s *Store) GetByID(ctx context.Context, id string) (*prompt.Prompt, error)

GetByID retrieves a prompt by ID. Returns nil, nil if not found.

func (*Store) List

func (s *Store) List(ctx context.Context, filter prompt.ListFilter) ([]prompt.Prompt, error)

List returns prompts matching the filter.

func (*Store) Update

func (s *Store) Update(ctx context.Context, p *prompt.Prompt) error

Update modifies an existing prompt identified by ID.

Jump to

Keyboard shortcuts

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