Documentation
¶
Index ¶
- Variables
- func ChangeConfig(db *DB, c Config)
- func QueryRow[T any](ctx context.Context, db *DB, query string, scanner SingleRowScanner[T], ...) (T, error)
- func QueryRows[T any](ctx context.Context, db *DB, query string, scanner Scanner[T], args ...any) ([]T, error)
- type Config
- type DB
- type Scanner
- type SingleRowScanner
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoConnection = errors.New("database connection not initialized") ErrNoRows = sql.ErrNoRows )
Common errors
Functions ¶
func ChangeConfig ¶ added in v0.1.2
Types ¶
type Config ¶ added in v0.1.2
type Config struct {
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
ConnMaxIdleTime time.Duration
}
Config represents database configuration
func DefaultConfig ¶ added in v0.1.2
func DefaultConfig() Config
DefaultConfig provides sensible defaults for database configuration
type DB ¶ added in v0.1.2
DB wraps sql.DB to provide additional functionality
func New ¶ added in v0.1.2
func New(source boiler.IOWithAuth) (*DB, error)
New creates a new database connection
func (*DB) Exec ¶ added in v0.1.2
Exec executes a query that doesn't return rows (INSERT, UPDATE, DELETE)
Click to show internal directories.
Click to hide internal directories.