database

package
v0.0.0-...-6e61812 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Filename       string
	CollectionName string
	Content        string
	Metadata       string
	CreatedAt      sql.NullString
	UpdatedAt      sql.NullString
}

type CreateCollectionItemParams

type CreateCollectionItemParams struct {
	Filename       string
	CollectionName string
	Content        string
	Metadata       string
}

type CreateCollectionItemRow

type CreateCollectionItemRow struct {
	Filename       string
	CollectionName string
	Content        string
	Metadata       string
	CreatedAt      sql.NullString
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteCollectionItemParams

type DeleteCollectionItemParams struct {
	Filename       string
	CollectionName string
}

type GetCollectionItemParams

type GetCollectionItemParams struct {
	Filename       string
	CollectionName string
}

type GetCollectionItemRow

type GetCollectionItemRow struct {
	Filename       string
	CollectionName string
	Content        string
	Metadata       string
	CreatedAt      sql.NullString
}

type ListAllCollectionItemsRow

type ListAllCollectionItemsRow struct {
	Filename  string
	Content   string
	Metadata  string
	CreatedAt sql.NullString
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) CreateCollectionItem

func (q *Queries) CreateCollectionItem(ctx context.Context, db DBTX, arg CreateCollectionItemParams) (CreateCollectionItemRow, error)

func (*Queries) DeleteCollectionItem

func (q *Queries) DeleteCollectionItem(ctx context.Context, db DBTX, arg DeleteCollectionItemParams) error

func (*Queries) GetCollectionItem

func (q *Queries) GetCollectionItem(ctx context.Context, db DBTX, arg GetCollectionItemParams) (GetCollectionItemRow, error)

func (*Queries) ListAllCollectionItems

func (q *Queries) ListAllCollectionItems(ctx context.Context, db DBTX, collectionName string) ([]ListAllCollectionItemsRow, error)

func (*Queries) UpdateCollectionItem

func (q *Queries) UpdateCollectionItem(ctx context.Context, db DBTX, arg UpdateCollectionItemParams) error

type QueryBuilder

type QueryBuilder struct {
	Query string
	Args  []interface{}
}

func BuildCollectionQuery

func BuildCollectionQuery(r *http.Request, collectionConfig *config.Collection) (*QueryBuilder, error)

buildCollectionQuery constructs a SQL query with filters based on form data and collection config

type UpdateCollectionItemParams

type UpdateCollectionItemParams struct {
	Content        string
	Metadata       string
	Filename       string
	CollectionName string
}

Jump to

Keyboard shortcuts

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