db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertPart

func InsertPart(ctx context.Context, db *sqlx.DB, p Part) error

InsertPart inserts the given part object into the database.

Types

type Part

type Part struct {
	ID   uuid.UUID `db:"part_id"`
	Name string    `db:"part_name"`

	TimeMetadata
}

Part is the db representation of an inventory part.

func GetPart

func GetPart(ctx context.Context, db *sqlx.DB, id uuid.UUID) (*Part, error)

GetPart fetchdes an individual part from the db based on it's ID.

type TimeMetadata

type TimeMetadata struct {
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	DeletedAt time.Time `db:"deleted_at"`
}

TimeMetadata is the common time metadata fields for all components.

Jump to

Keyboard shortcuts

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