storeql

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: GPL-3.0 Imports: 7 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFromDB

func DeleteFromDB(ctx context.Context, db *sqlx.DB, storable Storable) error

func InsertIntoDB

func InsertIntoDB(ctx context.Context, db *sqlx.DB, storables ...Storable) error

InsertIntoDB inserts the storable entity to the DB Finally, it assigns the inserted Id to the given entities

func UpdateIntoDB

func UpdateIntoDB(ctx context.Context, db *sqlx.DB, storables ...Storable) error

func UpsertIntoDB

func UpsertIntoDB(ctx context.Context, db *sqlx.DB, storables ...Storable) error

Types

type PqErr added in v1.1.0

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

func (*PqErr) Error added in v1.1.0

func (err *PqErr) Error() string

func (*PqErr) Is added in v1.1.0

func (err *PqErr) Is(errChecker func(error) *pq.Error) bool

type Storable

type Storable interface {
	GetId() uint64
	SetId(uint64)
	SQLTable() string
	SQLColumns() []string
}

Storable entity is any entity that can be stored in an SQL database

Directories

Path Synopsis
Package name contains the naming conventions of storeql
Package name contains the naming conventions of storeql
test
sqlhelp
Package sqlhelp contains testing helpers for sql transactions.
Package sqlhelp contains testing helpers for sql transactions.

Jump to

Keyboard shortcuts

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