database

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows = sql.ErrNoRows

Functions

This section is empty.

Types

type Database

type Database interface {
	Many(ctx context.Context, query string, params ...interface{}) (*sql.Rows, error)
	One(ctx context.Context, query string, params ...interface{}) *sql.Row
	Exec(ctx context.Context, query string, params ...interface{}) (sql.Result, error)
	Close()
}

func NewPGDatabase

func NewPGDatabase() Database

type PGDatabase

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

func (PGDatabase) Close

func (d PGDatabase) Close()

func (PGDatabase) Exec

func (d PGDatabase) Exec(ctx context.Context, query string, params ...interface{}) (sql.Result, error)

func (PGDatabase) Many

func (d PGDatabase) Many(ctx context.Context, query string, params ...interface{}) (*sql.Rows, error)

func (PGDatabase) One

func (d PGDatabase) One(ctx context.Context, query string, params ...interface{}) *sql.Row

Jump to

Keyboard shortcuts

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