package
0.3.0
Repository: https://github.com/acronis/go-dbkit.git
Documentation: pkg.go.dev

# Functions

BuildSQLAndExec is a function for running DML not returning any data like UPDATE, DELETE, INSERT.
BuildSQLAndQuery is a function for running SELECT statements returning many rows.
BuildSQLAndQueryRow is a function for running SELECT statements returning single row.
BuildSQLAndQueryScalar is a function for running SELECT statements returning single scalar value.
JSONDecoder is convenience function for reading JSON values from db.
JSONEncoder is convenience function for writing JSON values to db.
NewDB returns tx wrapper for goqu.Database.
NullTimeFrom creates valid NullTime from time.Time.
QueryAndScanStruct scans results into composite struct.
QueryAndScanStructs scans results into structs (using common goqu rules about tags) it allows scanning from queries that contain JOINs between tables other than INNER JOIN.
QueryAndScanValues runs SELECT and scans its result into values list, result is a pointer to slice of values: SELECT attr FROM t WHERE t.id > 123.
ScanEachRow is a helper for scanning multiple rows result set.

# Variables

ErrNotFound indicates that something was not found in db.
IsInsideTest when set to true enables some checks that are skipped for production code.
ObserveSQLQueryDuration is an actual instance of QueryDurationObserverFunc that is used.
PostQueryHook will be executed after actual query execution.
PreQueryHook will be executed before actual query execution.

# Structs

DB is a wrapper for goqu.Database.
NullTime is suitable in case of different functions working with time Note! It's suitable for in case you use goqu.MAX(date_column) on SQLite.
SQLBuilderSettings is sql builder settings representation.

# Interfaces

ContextProvider is an interface that defines a method for obtaining a context.Context.
Querier is an interface to abstract details of db implementation.
Scanner is an interface to abstract details of scanning db values.

# Type aliases

PostQueryFuncT is type for post query hook function.
PreQueryFuncT is type for pre query hook function.
QueryDurationObserverFunc is a function type to observe query related stats.