database

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSlice

func GetSlice(db *Database, query string) (any, error)

func PrepareSliceQuery

func PrepareSliceQuery(queryTemplate, sliceTemplate string, slice []any, args ...any) (string, []any, error)

Types

type Database

type Database struct {
	ConnectionString string `yaml:"connection_string,omitempty" json:"connection_string,omitempty"`
}

func (*Database) Deploy

func (d *Database) Deploy(listFile string) (err error)

func (*Database) NewSession

func (d *Database) NewSession(withTransaction bool) (*Session, error)

type Filter

type Filter map[string]string

func (*Filter) Render

func (f *Filter) Render(queryTemplate string, config *FilterConfig, args ...any) (string, []any, error)

type FilterConfig

type FilterConfig struct {
	Join       string
	Parameters map[string]*FilterParameter
}

type FilterParameter

type FilterParameter struct {
	IsSlice bool
	Value   string
	Item    string
	Join    string
}

type Session

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

func (*Session) Close

func (s *Session) Close() error

func (*Session) Commit

func (s *Session) Commit() error

func (*Session) Exec

func (s *Session) Exec(query string, args ...any) (int64, error)

func (*Session) InsertRow

func (s *Session) InsertRow(query string, args ...any) (int64, error)

func (*Session) Query

func (s *Session) Query(query string, args ...any) (*sql.Rows, error)

func (*Session) QueryRow

func (s *Session) QueryRow(query string, args ...any) (*sql.Row, error)

func (*Session) Rollback

func (s *Session) Rollback() error

func (*Session) SelectSet

func (s *Session) SelectSet(query string, args ...any) (*set.Set[string], error)

Jump to

Keyboard shortcuts

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