queries

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQueryDirNotExist  = errors.New("queries directory does not exist")
	ErrQueryFileNotExist = errors.New("query file does not exist")
)

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Title       string
	Description string
	Host        field
	User        field
	Database    field
	Mode        field
	Timeout     *time.Duration
}

type Query

type Query struct {
	ID   string
	Path string
	Meta *Metadata
	Data string
}

func (Query) IsPermitted

func (q Query) IsPermitted(host, user, database, mode string) bool

IsPermitted returns true if a query is allowed to execute for a given db context

type Store

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

func NewStore

func NewStore(dir string) *Store

func (Store) Read

func (s Store) Read(id string) (*Query, error)

func (Store) ReadAll

func (s Store) ReadAll() ([]Query, error)

Jump to

Keyboard shortcuts

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