update

package
v1.11.11 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package update handles edits and updates to the database records.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrColumn  = errors.New("column value must be either platform or section")
	ErrDB      = errors.New("database handle pointer cannot be nil")
	ErrPointer = errors.New("pointer value cannot be nil")
)

Functions

func Distinct

func Distinct(db *sql.DB, column string) ([]string, error)

Distinct returns a unique list of values from the table column. Column must be either platform or section.

func Platforms

func Platforms(db *sql.DB, w io.Writer, platforms *[]string) error

func Sections

func Sections(db *sql.DB, w io.Writer, sections *[]string) error

Types

type Column added in v1.10.0

type Column string
const (
	Filename Column = "files.filename"
	GroupBy  Column = "files.group_brand_by"
	GroupFor Column = "files.group_brand_for"
)

func (Column) NamedTitles added in v1.10.0

func (col Column) NamedTitles(db *sql.DB, w io.Writer) error

NamedTitles remove record titles that match the filename.

type Update

type Update struct {
	Query string // Query is an SQL statement.
	Args  []any  // Args are SQL statement values.
}

Update row values based on conditions.

func (Update) Execute

func (u Update) Execute(db *sql.DB) (int64, error)

Execute Query and Args to update the database and returns the total number of changes.

Jump to

Keyboard shortcuts

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