Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 13 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"`
	MaxOpenConns     int    `yaml:"max_open_conns,omitempty" json:"max_open_conns,omitempty"`
	MaxIdleConns     int    `yaml:"max_idle_conns,omitempty" json:"max_idle_conns,omitempty"`
	// contains filtered or unexported fields
}

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