postgres

package
v0.0.0-...-62f0cde Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package defines CRUD comms between service layer with model layer in postgres

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAttributesDriver

func NewAttributesDriver(db *sqlx.DB) models.AttributesRepository

NewAttributesDriver creates a sqlx.DB of attributes.Repository

func NewProductsDriver

func NewProductsDriver(db *sqlx.DB) models.ProductsRepository

NewProductsDriver defines a sqlx.DB represents products.Repository interface

Types

type AttributesDriver

type AttributesDriver struct {
	Conn *sqlx.DB
}

AttributesDriver ...

func (*AttributesDriver) FetchAll

func (p *AttributesDriver) FetchAll(ctx context.Context) (attr []models.Attributes, err error)

FetchAll returns attribute table

type ProductsDriver

type ProductsDriver struct {
	Conn *sqlx.DB
}

ProductsDriver ...

func (*ProductsDriver) FetchAll

func (p *ProductsDriver) FetchAll(ctx context.Context) (res []models.Products, err error)

FetchAll returns product_info table

func (*ProductsDriver) GetByID

func (p *ProductsDriver) GetByID(ctx context.Context, id int) (res []models.Products, err error)

GetByID returns list of attributes with the same id to get product_info

Jump to

Keyboard shortcuts

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