gensql

package
v0.0.0-...-9c71d87 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gensql provides SQL logic commonly shared between multiple implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBlobMeta

func DeleteBlobMeta(ctx context.Context, dl Dialect, blobId blid.Blid) error

DeleteBlobMeta wipes a blob from the db.

func GetBlobMeta

func GetBlobMeta(_ context.Context, dl Dialect, blobId blid.Blid) (*metadata.Item, bool, error)

GetBlobMeta returns blob metadata

func GetBlobTags

func GetBlobTags(ctx context.Context, dl Dialect, blobId blid.Blid) ([]string, error)

func ListBlobChunk

func ListBlobChunk(_ context.Context, dl Dialect, filter *filter.Filter, limit int) ([]*metadata.Item, error)

func SetBlobMeta

func SetBlobMeta(_ context.Context, dl Dialect, item *metadata.Item) error

SetBlobMeta sets blob metadata.

func SetBlobTags

func SetBlobTags(ctx context.Context, dl Dialect, tags []string, blobId blid.Blid) error

func SetupDB

func SetupDB(db *sql.DB, updates []SchemaSetupEntry) error

SetupDB ensures that the passed in tables are present.

Types

type Dialect

type Dialect interface {
	IsDuplicateKeyError(error) bool
	SetParamPlaceholders(string) string
	TimeToType(time.Time) any
	DB() *sql.DB
}

type SchemaSetupEntry

type SchemaSetupEntry struct {
	Table  string
	Schema string
}

Jump to

Keyboard shortcuts

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