Documentation ¶
Index ¶
- func ConnectSimpleTCP(login, password, addr, database string) (*sql.DB, error)
- func GetByID[T any](getter sqlt.Getter, table string, id any) (*T, error)
- func In(values ...any) (string, []any)
- func InString(values ...string) (string, []any)
- func InUint64(values ...uint64) (string, []any)
- func Insert(exec sqlt.Executor, table string, values map[string]any) (sql.Result, error)
- func InspectColumns(db sqlt.Querier, table string) ([]inspect.Column, error)
- func MakeGenericListReader[I, T any](db sqlt.Reader, table, column string) sqlt.GenericListReader[I, T]
- func MakeGenericReader[I, T any](db sqlt.Reader, table, column string) sqlt.GenericReader[I, T]
- func MakeGetByID[T any, I any](getter sqlt.Getter, table string) func(I) (*T, error)
- func MakeInsert[IN any, OUT any](exec sqlt.Executor, table string, mapIn func(IN) (map[string]any, error), ...) func(IN) (OUT, error)
- func MakeSelectByID[T any, I any](selector sqlt.Selector, table string) func(...I) ([]T, error)
- func Name(s string) string
- func SelectByID[T any](selector sqlt.Selector, table string, id ...any) (out []T, err error)
- func Update(exec sqlt.Executor, table string, values map[string]any, condition string, ...) (sql.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectSimpleTCP ¶ added in v1.5.0
ConnectSimpleTCP performs simple connection over TCP to requested address and database
func InspectColumns ¶ added in v1.4.0
InspectColumns reads columns data for given table
func MakeGenericListReader ¶ added in v1.6.0
func MakeGenericListReader[I, T any](db sqlt.Reader, table, column string) sqlt.GenericListReader[I, T]
MakeGenericListReader constructs accessor to database table able to match records by single column value (like id).
func MakeGenericReader ¶ added in v1.6.0
MakeGenericReader constructs accessor to database table able to match single record by single column value (like id).
func MakeGetByID ¶
MakeGetByID constructs function that reads single entity from database
func MakeInsert ¶
func MakeInsert[IN any, OUT any]( exec sqlt.Executor, table string, mapIn func(IN) (map[string]any, error), mapOut func(sql.Result) (OUT, error), ) func(IN) (OUT, error)
MakeInsert constructs function that places values into database
func MakeSelectByID ¶
MakeSelectByID constructs function that reads multiple entities by identifiers
func SelectByID ¶
SelectByID reads multiple entities by identifiers
Types ¶
This section is empty.