store

package
v0.0.0-...-7112f6d Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package store contains the abstractions and handlers to deal with the store (DB)

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 SQLColumns

func SQLColumns(storable Storable) []string

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 Storable

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

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

Jump to

Keyboard shortcuts

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