postgresql

package
v0.0.0-...-3cb0c2f Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

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

func (*Dialect) DB

func (d *Dialect) DB() *sql.DB

DB returns the database/sql dbh.

func (*Dialect) IsDuplicateKeyError

func (d *Dialect) IsDuplicateKeyError(err error) bool

IsDuplicateKeyError returns true if the given error is for a duplicated key / unique constraint error.

func (*Dialect) SetParamPlaceholders

func (d *Dialect) SetParamPlaceholders(sql string) string

func (*Dialect) TimeToType

func (d *Dialect) TimeToType(t time.Time) any

TimeToType returns the given time in the type supported by the db.

type PgSQL

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

func New

func New() (*PgSQL, error)

New returns a new PgSQL struct

func (*PgSQL) DeleteBlobMeta

func (px *PgSQL) DeleteBlobMeta(ctx context.Context, blobId blid.Blid) error

DeleteBlobMeta deletes metadata about a blob.

func (*PgSQL) GetBlobMeta

func (px *PgSQL) GetBlobMeta(ctx context.Context, blobId blid.Blid) (*metadata.Item, bool, error)

HasBlobMeta returns true if we have metadata about a given blob.

func (*PgSQL) GetBlobTags

func (px *PgSQL) GetBlobTags(ctx context.Context, blobId blid.Blid) ([]string, error)

GetBlobTags returns the tags attached to a certain blob.

func (*PgSQL) ListBlobChunk

func (px *PgSQL) ListBlobChunk(ctx context.Context, filter *filter.Filter, limit int) ([]*metadata.Item, error)

ListBlobChunk returns blob chunk metadata.

func (*PgSQL) SetBlobMeta

func (px *PgSQL) SetBlobMeta(ctx context.Context, item *metadata.Item) error

func (*PgSQL) SetBlobTags

func (px *PgSQL) SetBlobTags(ctx context.Context, tags []string, blobId blid.Blid) error

SetBlobTags updates tags of the given blob id.

Jump to

Keyboard shortcuts

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