postgres

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New creates a new PostgreSQL repository

func NewWithPool

func NewWithPool(pool *pgxpool.Pool) simplecontent.Repository

NewWithPool creates a new PostgreSQL repository with connection pool

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

DBTX is an interface that allows us to use either a database connection or a transaction

type Repository

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

Repository implements simplecontent.Repository using PostgreSQL

func (*Repository) CountContentWithFilters added in v0.1.15

func (r *Repository) CountContentWithFilters(ctx context.Context, filters simplecontent.ContentCountFilters) (int64, error)

func (*Repository) CreateContent

func (r *Repository) CreateContent(ctx context.Context, content *simplecontent.Content) error

func (*Repository) CreateDerivedContentRelationship

func (r *Repository) CreateDerivedContentRelationship(ctx context.Context, params simplecontent.CreateDerivedContentParams) (*simplecontent.DerivedContent, error)

func (*Repository) CreateObject

func (r *Repository) CreateObject(ctx context.Context, object *simplecontent.Object) error

func (*Repository) DeleteContent

func (r *Repository) DeleteContent(ctx context.Context, id uuid.UUID) error

func (*Repository) DeleteObject

func (r *Repository) DeleteObject(ctx context.Context, id uuid.UUID) error

func (*Repository) GetContent

func (r *Repository) GetContent(ctx context.Context, id uuid.UUID) (*simplecontent.Content, error)

func (*Repository) GetContentByStatus added in v0.1.19

func (r *Repository) GetContentByStatus(ctx context.Context, status string) ([]*simplecontent.Content, error)

func (*Repository) GetContentMetadata

func (r *Repository) GetContentMetadata(ctx context.Context, contentID uuid.UUID) (*simplecontent.ContentMetadata, error)

func (*Repository) GetContentMetadataByContentIDs added in v0.1.34

func (r *Repository) GetContentMetadataByContentIDs(ctx context.Context, contentIDs []uuid.UUID) (map[uuid.UUID]*simplecontent.ContentMetadata, error)

func (*Repository) GetContentStatistics added in v0.1.15

func (*Repository) GetContentsByIDs added in v0.1.34

func (r *Repository) GetContentsByIDs(ctx context.Context, ids []uuid.UUID) ([]*simplecontent.Content, error)

func (*Repository) GetDerivedRelationshipByContentID added in v0.1.1

func (r *Repository) GetDerivedRelationshipByContentID(ctx context.Context, contentID uuid.UUID) (*simplecontent.DerivedContent, error)

func (*Repository) GetObject

func (r *Repository) GetObject(ctx context.Context, id uuid.UUID) (*simplecontent.Object, error)

func (*Repository) GetObjectByObjectKeyAndStorageBackendName

func (r *Repository) GetObjectByObjectKeyAndStorageBackendName(ctx context.Context, objectKey, storageBackendName string) (*simplecontent.Object, error)

func (*Repository) GetObjectMetadata

func (r *Repository) GetObjectMetadata(ctx context.Context, objectID uuid.UUID) (*simplecontent.ObjectMetadata, error)

func (*Repository) GetObjectMetadataByObjectIDs added in v0.1.34

func (r *Repository) GetObjectMetadataByObjectIDs(ctx context.Context, objectIDs []uuid.UUID) (map[uuid.UUID]*simplecontent.ObjectMetadata, error)

func (*Repository) GetObjectsByContentID

func (r *Repository) GetObjectsByContentID(ctx context.Context, contentID uuid.UUID) ([]*simplecontent.Object, error)

func (*Repository) GetObjectsByContentIDs added in v0.1.34

func (r *Repository) GetObjectsByContentIDs(ctx context.Context, contentIDs []uuid.UUID) (map[uuid.UUID][]*simplecontent.Object, error)

func (*Repository) GetObjectsByStatus added in v0.1.19

func (r *Repository) GetObjectsByStatus(ctx context.Context, status string) ([]*simplecontent.Object, error)

func (*Repository) ListContent

func (r *Repository) ListContent(ctx context.Context, ownerID, tenantID uuid.UUID) ([]*simplecontent.Content, error)

func (*Repository) ListContentWithFilters added in v0.1.15

func (r *Repository) ListContentWithFilters(ctx context.Context, filters simplecontent.ContentListFilters) ([]*simplecontent.Content, error)

func (*Repository) ListDerivedContent

func (*Repository) SetContentMetadata

func (r *Repository) SetContentMetadata(ctx context.Context, metadata *simplecontent.ContentMetadata) error

func (*Repository) SetObjectMetadata

func (r *Repository) SetObjectMetadata(ctx context.Context, metadata *simplecontent.ObjectMetadata) error

func (*Repository) UpdateContent

func (r *Repository) UpdateContent(ctx context.Context, content *simplecontent.Content) error

func (*Repository) UpdateObject

func (r *Repository) UpdateObject(ctx context.Context, object *simplecontent.Object) error

Jump to

Keyboard shortcuts

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