insert

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package insert adds Demozoo productions to the Defacto2 database.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrID      = errors.New("production id must be 1 or higher")
	ErrNoQuery = errors.New("query statement is empty")
	ErrProd    = errors.New("productions pointer cannot be nil")
)

Functions

func Prods added in v1.7.0

func Prods(db *sql.DB, w io.Writer, prods *releases.Productions) error

Prods adds the Demozoo releasers productions to the database. API: https://demozoo.org/api/v1/releasers/

Types

type Record

type Record struct {
	WebIDDemozoo uint   // Demozoo production ID.
	ID           string // MySQL auto increment ID.
	UUID         string // Unique ID for the record.
	Title        string
	Platform     string
	Section      string
	GroupFor     string
	GroupBy      string
	CreditText   []string
	CreditCode   []string
	CreditArt    []string
	CreditAudio  []string
	IssuedYear   uint16
	IssuedMonth  uint8
	IssuedDay    uint8
}

Record contains the values for a new Demozoo releaser production to be added to the database file table.

func Prod added in v1.7.0

func Prod(db *sql.DB, w io.Writer, prod releases.ProductionV1) (Record, error)

Prod mutates the raw Demozoo API releaser production data to database ready values.

func (*Record) Insert

func (r *Record) Insert(db *sql.DB) (sql.Result, error)

Insert the new Demozoo releaser production into the database.

Jump to

Keyboard shortcuts

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