models

package
v0.0.0-...-5c48978 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Index

Constants

View Source
const (
	// MpaaRatingG is the 'G' MpaaRating.
	MpaaRatingG = MpaaRating(1)

	// MpaaRatingPg is the 'PG' MpaaRating.
	MpaaRatingPg = MpaaRating(2)

	// MpaaRatingPg13 is the 'PG-13' MpaaRating.
	MpaaRatingPg13 = MpaaRating(3)

	// MpaaRatingR is the 'R' MpaaRating.
	MpaaRatingR = MpaaRating(4)

	// MpaaRatingNc17 is the 'NC-17' MpaaRating.
	MpaaRatingNc17 = MpaaRating(5)
)

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

func FilmInStock

func FilmInStock(db XODB, v0 int, v1 int) ([]int, error)

FilmInStock calls the stored procedure 'public.film_in_stock(integer, integer) SETOF integer' on db.

func FilmNotInStock

func FilmNotInStock(db XODB, v0 int, v1 int) ([]int, error)

FilmNotInStock calls the stored procedure 'public.film_not_in_stock(integer, integer) SETOF integer' on db.

func GetCustomerBalance

func GetCustomerBalance(db XODB, v0 int, v1 time.Time) (float64, error)

GetCustomerBalance calls the stored procedure 'public.get_customer_balance(integer, timestamp without time zone) numeric' on db.

func GroupConcat

func GroupConcat(db XODB, v0 string, v1 string) (string, error)

GroupConcat calls the stored procedure 'public._group_concat(text, text) text' on db.

func InventoryHeldByCustomer

func InventoryHeldByCustomer(db XODB, v0 int) (int, error)

InventoryHeldByCustomer calls the stored procedure 'public.inventory_held_by_customer(integer) integer' on db.

func InventoryInStock

func InventoryInStock(db XODB, v0 int) (bool, error)

InventoryInStock calls the stored procedure 'public.inventory_in_stock(integer) boolean' on db.

func LastDay

func LastDay(db XODB, v0 time.Time) (time.Time, error)

LastDay calls the stored procedure 'public.last_day(timestamp without time zone) date' on db.

Types

type Actor

type Actor struct {
	ActorID    int       `json:"actor_id"`    // actor_id
	FirstName  string    `json:"first_name"`  // first_name
	LastName   string    `json:"last_name"`   // last_name
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

Actor represents a row from 'public.actor'.

func ActorByActorID

func ActorByActorID(db XODB, actorID int) (*Actor, error)

ActorByActorID retrieves a row from 'public.actor' as a Actor.

Generated from index 'actor_pkey'.

func ActorsByLastName

func ActorsByLastName(db XODB, lastName string) ([]*Actor, error)

ActorsByLastName retrieves a row from 'public.actor' as a Actor.

Generated from index 'idx_actor_last_name'.

func (*Actor) Delete

func (a *Actor) Delete(db XODB) error

Delete deletes the Actor from the database.

func (*Actor) Deleted

func (a *Actor) Deleted() bool

Deleted provides information if the Actor has been deleted from the database.

func (*Actor) Exists

func (a *Actor) Exists() bool

Exists determines if the Actor exists in the database.

func (*Actor) Insert

func (a *Actor) Insert(db XODB) error

Insert inserts the Actor to the database.

func (*Actor) Save

func (a *Actor) Save(db XODB) error

Save saves the Actor to the database.

func (*Actor) Update

func (a *Actor) Update(db XODB) error

Update updates the Actor in the database.

func (*Actor) Upsert

func (a *Actor) Upsert(db XODB) error

Upsert performs an upsert for Actor.

NOTE: PostgreSQL 9.5+ only

type ActorInfo

type ActorInfo struct {
	ActorID   sql.NullInt64  `json:"actor_id"`   // actor_id
	FirstName sql.NullString `json:"first_name"` // first_name
	LastName  sql.NullString `json:"last_name"`  // last_name
	FilmInfo  sql.NullString `json:"film_info"`  // film_info
}

ActorInfo represents a row from 'public.actor_info'.

type Address

type Address struct {
	AddressID  int            `json:"address_id"`  // address_id
	Address    string         `json:"address"`     // address
	Address2   sql.NullString `json:"address2"`    // address2
	District   string         `json:"district"`    // district
	CityID     int16          `json:"city_id"`     // city_id
	PostalCode sql.NullString `json:"postal_code"` // postal_code
	Phone      string         `json:"phone"`       // phone
	LastUpdate time.Time      `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

Address represents a row from 'public.address'.

func AddressByAddressID

func AddressByAddressID(db XODB, addressID int) (*Address, error)

AddressByAddressID retrieves a row from 'public.address' as a Address.

Generated from index 'address_pkey'.

func AddressesByCityID

func AddressesByCityID(db XODB, cityID int16) ([]*Address, error)

AddressesByCityID retrieves a row from 'public.address' as a Address.

Generated from index 'idx_fk_city_id'.

func (*Address) City

func (a *Address) City(db XODB) (*City, error)

City returns the City associated with the Address's CityID (city_id).

Generated from foreign key 'fk_address_city'.

func (*Address) Delete

func (a *Address) Delete(db XODB) error

Delete deletes the Address from the database.

func (*Address) Deleted

func (a *Address) Deleted() bool

Deleted provides information if the Address has been deleted from the database.

func (*Address) Exists

func (a *Address) Exists() bool

Exists determines if the Address exists in the database.

func (*Address) Insert

func (a *Address) Insert(db XODB) error

Insert inserts the Address to the database.

func (*Address) Save

func (a *Address) Save(db XODB) error

Save saves the Address to the database.

func (*Address) Update

func (a *Address) Update(db XODB) error

Update updates the Address in the database.

func (*Address) Upsert

func (a *Address) Upsert(db XODB) error

Upsert performs an upsert for Address.

NOTE: PostgreSQL 9.5+ only

type Category

type Category struct {
	CategoryID int       `json:"category_id"` // category_id
	Name       string    `json:"name"`        // name
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

Category represents a row from 'public.category'.

func CategoryByCategoryID

func CategoryByCategoryID(db XODB, categoryID int) (*Category, error)

CategoryByCategoryID retrieves a row from 'public.category' as a Category.

Generated from index 'category_pkey'.

func (*Category) Delete

func (c *Category) Delete(db XODB) error

Delete deletes the Category from the database.

func (*Category) Deleted

func (c *Category) Deleted() bool

Deleted provides information if the Category has been deleted from the database.

func (*Category) Exists

func (c *Category) Exists() bool

Exists determines if the Category exists in the database.

func (*Category) Insert

func (c *Category) Insert(db XODB) error

Insert inserts the Category to the database.

func (*Category) Save

func (c *Category) Save(db XODB) error

Save saves the Category to the database.

func (*Category) Update

func (c *Category) Update(db XODB) error

Update updates the Category in the database.

func (*Category) Upsert

func (c *Category) Upsert(db XODB) error

Upsert performs an upsert for Category.

NOTE: PostgreSQL 9.5+ only

type City

type City struct {
	CityID     int       `json:"city_id"`     // city_id
	City       string    `json:"city"`        // city
	CountryID  int16     `json:"country_id"`  // country_id
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

City represents a row from 'public.city'.

func CitiesByCountryID

func CitiesByCountryID(db XODB, countryID int16) ([]*City, error)

CitiesByCountryID retrieves a row from 'public.city' as a City.

Generated from index 'idx_fk_country_id'.

func CityByCityID

func CityByCityID(db XODB, cityID int) (*City, error)

CityByCityID retrieves a row from 'public.city' as a City.

Generated from index 'city_pkey'.

func (*City) Country

func (c *City) Country(db XODB) (*Country, error)

Country returns the Country associated with the City's CountryID (country_id).

Generated from foreign key 'fk_city'.

func (*City) Delete

func (c *City) Delete(db XODB) error

Delete deletes the City from the database.

func (*City) Deleted

func (c *City) Deleted() bool

Deleted provides information if the City has been deleted from the database.

func (*City) Exists

func (c *City) Exists() bool

Exists determines if the City exists in the database.

func (*City) Insert

func (c *City) Insert(db XODB) error

Insert inserts the City to the database.

func (*City) Save

func (c *City) Save(db XODB) error

Save saves the City to the database.

func (*City) Update

func (c *City) Update(db XODB) error

Update updates the City in the database.

func (*City) Upsert

func (c *City) Upsert(db XODB) error

Upsert performs an upsert for City.

NOTE: PostgreSQL 9.5+ only

type Country

type Country struct {
	CountryID  int       `json:"country_id"`  // country_id
	Country    string    `json:"country"`     // country
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

Country represents a row from 'public.country'.

func CountryByCountryID

func CountryByCountryID(db XODB, countryID int) (*Country, error)

CountryByCountryID retrieves a row from 'public.country' as a Country.

Generated from index 'country_pkey'.

func (*Country) Delete

func (c *Country) Delete(db XODB) error

Delete deletes the Country from the database.

func (*Country) Deleted

func (c *Country) Deleted() bool

Deleted provides information if the Country has been deleted from the database.

func (*Country) Exists

func (c *Country) Exists() bool

Exists determines if the Country exists in the database.

func (*Country) Insert

func (c *Country) Insert(db XODB) error

Insert inserts the Country to the database.

func (*Country) Save

func (c *Country) Save(db XODB) error

Save saves the Country to the database.

func (*Country) Update

func (c *Country) Update(db XODB) error

Update updates the Country in the database.

func (*Country) Upsert

func (c *Country) Upsert(db XODB) error

Upsert performs an upsert for Country.

NOTE: PostgreSQL 9.5+ only

type Customer

type Customer struct {
	CustomerID int            `json:"customer_id"` // customer_id
	StoreID    int16          `json:"store_id"`    // store_id
	FirstName  string         `json:"first_name"`  // first_name
	LastName   string         `json:"last_name"`   // last_name
	Email      sql.NullString `json:"email"`       // email
	AddressID  int16          `json:"address_id"`  // address_id
	Activebool bool           `json:"activebool"`  // activebool
	CreateDate time.Time      `json:"create_date"` // create_date
	LastUpdate pq.NullTime    `json:"last_update"` // last_update
	Active     sql.NullInt64  `json:"active"`      // active
	// contains filtered or unexported fields
}

Customer represents a row from 'public.customer'.

func CustomerByCustomerID

func CustomerByCustomerID(db XODB, customerID int) (*Customer, error)

CustomerByCustomerID retrieves a row from 'public.customer' as a Customer.

Generated from index 'customer_pkey'.

func CustomersByAddressID

func CustomersByAddressID(db XODB, addressID int16) ([]*Customer, error)

CustomersByAddressID retrieves a row from 'public.customer' as a Customer.

Generated from index 'idx_fk_address_id'.

func CustomersByLastName

func CustomersByLastName(db XODB, lastName string) ([]*Customer, error)

CustomersByLastName retrieves a row from 'public.customer' as a Customer.

Generated from index 'idx_last_name'.

func CustomersByStoreID

func CustomersByStoreID(db XODB, storeID int16) ([]*Customer, error)

CustomersByStoreID retrieves a row from 'public.customer' as a Customer.

Generated from index 'idx_fk_store_id'.

func RewardsReport

func RewardsReport(db XODB, v0 int, v1 float64) ([]Customer, error)

RewardsReport calls the stored procedure 'public.rewards_report(integer, numeric) SETOF customer' on db.

func (*Customer) Address

func (c *Customer) Address(db XODB) (*Address, error)

Address returns the Address associated with the Customer's AddressID (address_id).

Generated from foreign key 'customer_address_id_fkey'.

func (*Customer) Delete

func (c *Customer) Delete(db XODB) error

Delete deletes the Customer from the database.

func (*Customer) Deleted

func (c *Customer) Deleted() bool

Deleted provides information if the Customer has been deleted from the database.

func (*Customer) Exists

func (c *Customer) Exists() bool

Exists determines if the Customer exists in the database.

func (*Customer) Insert

func (c *Customer) Insert(db XODB) error

Insert inserts the Customer to the database.

func (*Customer) Save

func (c *Customer) Save(db XODB) error

Save saves the Customer to the database.

func (*Customer) Update

func (c *Customer) Update(db XODB) error

Update updates the Customer in the database.

func (*Customer) Upsert

func (c *Customer) Upsert(db XODB) error

Upsert performs an upsert for Customer.

NOTE: PostgreSQL 9.5+ only

type CustomerList

type CustomerList struct {
	ID      sql.NullInt64  `json:"id"`       // id
	Name    sql.NullString `json:"name"`     // name
	Address sql.NullString `json:"address"`  // address
	ZipCode sql.NullString `json:"zip code"` // zip code
	Phone   sql.NullString `json:"phone"`    // phone
	City    sql.NullString `json:"city"`     // city
	Country sql.NullString `json:"country"`  // country
	Notes   sql.NullString `json:"notes"`    // notes
	Sid     sql.NullInt64  `json:"sid"`      // sid
}

CustomerList represents a row from 'public.customer_list'.

type Film

type Film struct {
	FilmID          int              `json:"film_id"`          // film_id
	Title           string           `json:"title"`            // title
	Description     sql.NullString   `json:"description"`      // description
	ReleaseYear     string           `json:"release_year"`     // release_year
	LanguageID      int16            `json:"language_id"`      // language_id
	RentalDuration  int16            `json:"rental_duration"`  // rental_duration
	RentalRate      float64          `json:"rental_rate"`      // rental_rate
	Length          sql.NullInt64    `json:"length"`           // length
	ReplacementCost float64          `json:"replacement_cost"` // replacement_cost
	Rating          MpaaRating       `json:"rating"`           // rating
	LastUpdate      time.Time        `json:"last_update"`      // last_update
	SpecialFeatures []sql.NullString `json:"special_features"` // special_features
	Fulltext        string           `json:"fulltext"`         // fulltext
	// contains filtered or unexported fields
}

Film represents a row from 'public.film'.

func FilmByFilmID

func FilmByFilmID(db XODB, filmID int) (*Film, error)

FilmByFilmID retrieves a row from 'public.film' as a Film.

Generated from index 'film_pkey'.

func FilmsByFulltext

func FilmsByFulltext(db XODB, fulltext string) ([]*Film, error)

FilmsByFulltext retrieves a row from 'public.film' as a Film.

Generated from index 'film_fulltext_idx'.

func FilmsByLanguageID

func FilmsByLanguageID(db XODB, languageID int16) ([]*Film, error)

FilmsByLanguageID retrieves a row from 'public.film' as a Film.

Generated from index 'idx_fk_language_id'.

func FilmsByTitle

func FilmsByTitle(db XODB, title string) ([]*Film, error)

FilmsByTitle retrieves a row from 'public.film' as a Film.

Generated from index 'idx_title'.

func (*Film) Delete

func (f *Film) Delete(db XODB) error

Delete deletes the Film from the database.

func (*Film) Deleted

func (f *Film) Deleted() bool

Deleted provides information if the Film has been deleted from the database.

func (*Film) Exists

func (f *Film) Exists() bool

Exists determines if the Film exists in the database.

func (*Film) Insert

func (f *Film) Insert(db XODB) error

Insert inserts the Film to the database.

func (*Film) Language

func (f *Film) Language(db XODB) (*Language, error)

Language returns the Language associated with the Film's LanguageID (language_id).

Generated from foreign key 'film_language_id_fkey'.

func (*Film) Save

func (f *Film) Save(db XODB) error

Save saves the Film to the database.

func (*Film) Update

func (f *Film) Update(db XODB) error

Update updates the Film in the database.

func (*Film) Upsert

func (f *Film) Upsert(db XODB) error

Upsert performs an upsert for Film.

NOTE: PostgreSQL 9.5+ only

type FilmActor

type FilmActor struct {
	ActorID    int16     `json:"actor_id"`    // actor_id
	FilmID     int16     `json:"film_id"`     // film_id
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

FilmActor represents a row from 'public.film_actor'.

func FilmActorByActorIDFilmID

func FilmActorByActorIDFilmID(db XODB, actorID int16, filmID int16) (*FilmActor, error)

FilmActorByActorIDFilmID retrieves a row from 'public.film_actor' as a FilmActor.

Generated from index 'film_actor_pkey'.

func FilmActorsByFilmID

func FilmActorsByFilmID(db XODB, filmID int16) ([]*FilmActor, error)

FilmActorsByFilmID retrieves a row from 'public.film_actor' as a FilmActor.

Generated from index 'idx_fk_film_id'.

func (*FilmActor) Actor

func (fa *FilmActor) Actor(db XODB) (*Actor, error)

Actor returns the Actor associated with the FilmActor's ActorID (actor_id).

Generated from foreign key 'film_actor_actor_id_fkey'.

func (*FilmActor) Delete

func (fa *FilmActor) Delete(db XODB) error

Delete deletes the FilmActor from the database.

func (*FilmActor) Deleted

func (fa *FilmActor) Deleted() bool

Deleted provides information if the FilmActor has been deleted from the database.

func (*FilmActor) Exists

func (fa *FilmActor) Exists() bool

Exists determines if the FilmActor exists in the database.

func (*FilmActor) Film

func (fa *FilmActor) Film(db XODB) (*Film, error)

Film returns the Film associated with the FilmActor's FilmID (film_id).

Generated from foreign key 'film_actor_film_id_fkey'.

func (*FilmActor) Insert

func (fa *FilmActor) Insert(db XODB) error

Insert inserts the FilmActor to the database.

func (*FilmActor) Save

func (fa *FilmActor) Save(db XODB) error

Save saves the FilmActor to the database.

func (*FilmActor) Update

func (fa *FilmActor) Update(db XODB) error

Update updates the FilmActor in the database.

func (*FilmActor) Upsert

func (fa *FilmActor) Upsert(db XODB) error

Upsert performs an upsert for FilmActor.

NOTE: PostgreSQL 9.5+ only

type FilmCategory

type FilmCategory struct {
	FilmID     int16     `json:"film_id"`     // film_id
	CategoryID int16     `json:"category_id"` // category_id
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

FilmCategory represents a row from 'public.film_category'.

func FilmCategoryByFilmIDCategoryID

func FilmCategoryByFilmIDCategoryID(db XODB, filmID int16, categoryID int16) (*FilmCategory, error)

FilmCategoryByFilmIDCategoryID retrieves a row from 'public.film_category' as a FilmCategory.

Generated from index 'film_category_pkey'.

func (*FilmCategory) Category

func (fc *FilmCategory) Category(db XODB) (*Category, error)

Category returns the Category associated with the FilmCategory's CategoryID (category_id).

Generated from foreign key 'film_category_category_id_fkey'.

func (*FilmCategory) Delete

func (fc *FilmCategory) Delete(db XODB) error

Delete deletes the FilmCategory from the database.

func (*FilmCategory) Deleted

func (fc *FilmCategory) Deleted() bool

Deleted provides information if the FilmCategory has been deleted from the database.

func (*FilmCategory) Exists

func (fc *FilmCategory) Exists() bool

Exists determines if the FilmCategory exists in the database.

func (*FilmCategory) Film

func (fc *FilmCategory) Film(db XODB) (*Film, error)

Film returns the Film associated with the FilmCategory's FilmID (film_id).

Generated from foreign key 'film_category_film_id_fkey'.

func (*FilmCategory) Insert

func (fc *FilmCategory) Insert(db XODB) error

Insert inserts the FilmCategory to the database.

func (*FilmCategory) Save

func (fc *FilmCategory) Save(db XODB) error

Save saves the FilmCategory to the database.

func (*FilmCategory) Update

func (fc *FilmCategory) Update(db XODB) error

Update updates the FilmCategory in the database.

func (*FilmCategory) Upsert

func (fc *FilmCategory) Upsert(db XODB) error

Upsert performs an upsert for FilmCategory.

NOTE: PostgreSQL 9.5+ only

type FilmList

type FilmList struct {
	Fid         sql.NullInt64   `json:"fid"`         // fid
	Title       sql.NullString  `json:"title"`       // title
	Description sql.NullString  `json:"description"` // description
	Category    sql.NullString  `json:"category"`    // category
	Price       sql.NullFloat64 `json:"price"`       // price
	Length      sql.NullInt64   `json:"length"`      // length
	Rating      MpaaRating      `json:"rating"`      // rating
	Actors      sql.NullString  `json:"actors"`      // actors
}

FilmList represents a row from 'public.film_list'.

type Inventory

type Inventory struct {
	InventoryID int       `json:"inventory_id"` // inventory_id
	FilmID      int16     `json:"film_id"`      // film_id
	StoreID     int16     `json:"store_id"`     // store_id
	LastUpdate  time.Time `json:"last_update"`  // last_update
	// contains filtered or unexported fields
}

Inventory represents a row from 'public.inventory'.

func InventoriesByStoreIDFilmID

func InventoriesByStoreIDFilmID(db XODB, storeID int16, filmID int16) ([]*Inventory, error)

InventoriesByStoreIDFilmID retrieves a row from 'public.inventory' as a Inventory.

Generated from index 'idx_store_id_film_id'.

func InventoryByInventoryID

func InventoryByInventoryID(db XODB, inventoryID int) (*Inventory, error)

InventoryByInventoryID retrieves a row from 'public.inventory' as a Inventory.

Generated from index 'inventory_pkey'.

func (*Inventory) Delete

func (i *Inventory) Delete(db XODB) error

Delete deletes the Inventory from the database.

func (*Inventory) Deleted

func (i *Inventory) Deleted() bool

Deleted provides information if the Inventory has been deleted from the database.

func (*Inventory) Exists

func (i *Inventory) Exists() bool

Exists determines if the Inventory exists in the database.

func (*Inventory) Film

func (i *Inventory) Film(db XODB) (*Film, error)

Film returns the Film associated with the Inventory's FilmID (film_id).

Generated from foreign key 'inventory_film_id_fkey'.

func (*Inventory) Insert

func (i *Inventory) Insert(db XODB) error

Insert inserts the Inventory to the database.

func (*Inventory) Save

func (i *Inventory) Save(db XODB) error

Save saves the Inventory to the database.

func (*Inventory) Update

func (i *Inventory) Update(db XODB) error

Update updates the Inventory in the database.

func (*Inventory) Upsert

func (i *Inventory) Upsert(db XODB) error

Upsert performs an upsert for Inventory.

NOTE: PostgreSQL 9.5+ only

type Language

type Language struct {
	LanguageID int       `json:"language_id"` // language_id
	Name       string    `json:"name"`        // name
	LastUpdate time.Time `json:"last_update"` // last_update
	// contains filtered or unexported fields
}

Language represents a row from 'public.language'.

func LanguageByLanguageID

func LanguageByLanguageID(db XODB, languageID int) (*Language, error)

LanguageByLanguageID retrieves a row from 'public.language' as a Language.

Generated from index 'language_pkey'.

func (*Language) Delete

func (l *Language) Delete(db XODB) error

Delete deletes the Language from the database.

func (*Language) Deleted

func (l *Language) Deleted() bool

Deleted provides information if the Language has been deleted from the database.

func (*Language) Exists

func (l *Language) Exists() bool

Exists determines if the Language exists in the database.

func (*Language) Insert

func (l *Language) Insert(db XODB) error

Insert inserts the Language to the database.

func (*Language) Save

func (l *Language) Save(db XODB) error

Save saves the Language to the database.

func (*Language) Update

func (l *Language) Update(db XODB) error

Update updates the Language in the database.

func (*Language) Upsert

func (l *Language) Upsert(db XODB) error

Upsert performs an upsert for Language.

NOTE: PostgreSQL 9.5+ only

type MpaaRating

type MpaaRating uint16

MpaaRating is the 'mpaa_rating' enum type from schema 'public'.

func (MpaaRating) MarshalText

func (mr MpaaRating) MarshalText() ([]byte, error)

MarshalText marshals MpaaRating into text.

func (*MpaaRating) Scan

func (mr *MpaaRating) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for MpaaRating.

func (MpaaRating) String

func (mr MpaaRating) String() string

String returns the string value of the MpaaRating.

func (*MpaaRating) UnmarshalText

func (mr *MpaaRating) UnmarshalText(text []byte) error

UnmarshalText unmarshals MpaaRating from text.

func (MpaaRating) Value

func (mr MpaaRating) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for MpaaRating.

type NicerButSlowerFilmList

type NicerButSlowerFilmList struct {
	Fid         sql.NullInt64   `json:"fid"`         // fid
	Title       sql.NullString  `json:"title"`       // title
	Description sql.NullString  `json:"description"` // description
	Category    sql.NullString  `json:"category"`    // category
	Price       sql.NullFloat64 `json:"price"`       // price
	Length      sql.NullInt64   `json:"length"`      // length
	Rating      MpaaRating      `json:"rating"`      // rating
	Actors      sql.NullString  `json:"actors"`      // actors
}

NicerButSlowerFilmList represents a row from 'public.nicer_but_slower_film_list'.

type Payment

type Payment struct {
	PaymentID   int       `json:"payment_id"`   // payment_id
	CustomerID  int16     `json:"customer_id"`  // customer_id
	StaffID     int16     `json:"staff_id"`     // staff_id
	RentalID    int       `json:"rental_id"`    // rental_id
	Amount      float64   `json:"amount"`       // amount
	PaymentDate time.Time `json:"payment_date"` // payment_date
	// contains filtered or unexported fields
}

Payment represents a row from 'public.payment'.

func PaymentByPaymentID

func PaymentByPaymentID(db XODB, paymentID int) (*Payment, error)

PaymentByPaymentID retrieves a row from 'public.payment' as a Payment.

Generated from index 'payment_pkey'.

func PaymentsByCustomerID

func PaymentsByCustomerID(db XODB, customerID int16) ([]*Payment, error)

PaymentsByCustomerID retrieves a row from 'public.payment' as a Payment.

Generated from index 'idx_fk_customer_id'.

func PaymentsByRentalID

func PaymentsByRentalID(db XODB, rentalID int) ([]*Payment, error)

PaymentsByRentalID retrieves a row from 'public.payment' as a Payment.

Generated from index 'idx_fk_rental_id'.

func PaymentsByStaffID

func PaymentsByStaffID(db XODB, staffID int16) ([]*Payment, error)

PaymentsByStaffID retrieves a row from 'public.payment' as a Payment.

Generated from index 'idx_fk_staff_id'.

func (*Payment) Customer

func (p *Payment) Customer(db XODB) (*Customer, error)

Customer returns the Customer associated with the Payment's CustomerID (customer_id).

Generated from foreign key 'payment_customer_id_fkey'.

func (*Payment) Delete

func (p *Payment) Delete(db XODB) error

Delete deletes the Payment from the database.

func (*Payment) Deleted

func (p *Payment) Deleted() bool

Deleted provides information if the Payment has been deleted from the database.

func (*Payment) Exists

func (p *Payment) Exists() bool

Exists determines if the Payment exists in the database.

func (*Payment) Insert

func (p *Payment) Insert(db XODB) error

Insert inserts the Payment to the database.

func (*Payment) Rental

func (p *Payment) Rental(db XODB) (*Rental, error)

Rental returns the Rental associated with the Payment's RentalID (rental_id).

Generated from foreign key 'payment_rental_id_fkey'.

func (*Payment) Save

func (p *Payment) Save(db XODB) error

Save saves the Payment to the database.

func (*Payment) Staff

func (p *Payment) Staff(db XODB) (*Staff, error)

Staff returns the Staff associated with the Payment's StaffID (staff_id).

Generated from foreign key 'payment_staff_id_fkey'.

func (*Payment) Update

func (p *Payment) Update(db XODB) error

Update updates the Payment in the database.

func (*Payment) Upsert

func (p *Payment) Upsert(db XODB) error

Upsert performs an upsert for Payment.

NOTE: PostgreSQL 9.5+ only

type Rental

type Rental struct {
	RentalID    int         `json:"rental_id"`    // rental_id
	RentalDate  time.Time   `json:"rental_date"`  // rental_date
	InventoryID int         `json:"inventory_id"` // inventory_id
	CustomerID  int16       `json:"customer_id"`  // customer_id
	ReturnDate  pq.NullTime `json:"return_date"`  // return_date
	StaffID     int16       `json:"staff_id"`     // staff_id
	LastUpdate  time.Time   `json:"last_update"`  // last_update
	// contains filtered or unexported fields
}

Rental represents a row from 'public.rental'.

func RentalByRentalDateInventoryIDCustomerID

func RentalByRentalDateInventoryIDCustomerID(db XODB, rentalDate time.Time, inventoryID int, customerID int16) (*Rental, error)

RentalByRentalDateInventoryIDCustomerID retrieves a row from 'public.rental' as a Rental.

Generated from index 'idx_unq_rental_rental_date_inventory_id_customer_id'.

func RentalByRentalID

func RentalByRentalID(db XODB, rentalID int) (*Rental, error)

RentalByRentalID retrieves a row from 'public.rental' as a Rental.

Generated from index 'rental_pkey'.

func RentalsByInventoryID

func RentalsByInventoryID(db XODB, inventoryID int) ([]*Rental, error)

RentalsByInventoryID retrieves a row from 'public.rental' as a Rental.

Generated from index 'idx_fk_inventory_id'.

func (*Rental) Customer

func (r *Rental) Customer(db XODB) (*Customer, error)

Customer returns the Customer associated with the Rental's CustomerID (customer_id).

Generated from foreign key 'rental_customer_id_fkey'.

func (*Rental) Delete

func (r *Rental) Delete(db XODB) error

Delete deletes the Rental from the database.

func (*Rental) Deleted

func (r *Rental) Deleted() bool

Deleted provides information if the Rental has been deleted from the database.

func (*Rental) Exists

func (r *Rental) Exists() bool

Exists determines if the Rental exists in the database.

func (*Rental) Insert

func (r *Rental) Insert(db XODB) error

Insert inserts the Rental to the database.

func (*Rental) Inventory

func (r *Rental) Inventory(db XODB) (*Inventory, error)

Inventory returns the Inventory associated with the Rental's InventoryID (inventory_id).

Generated from foreign key 'rental_inventory_id_fkey'.

func (*Rental) Save

func (r *Rental) Save(db XODB) error

Save saves the Rental to the database.

func (*Rental) Staff

func (r *Rental) Staff(db XODB) (*Staff, error)

Staff returns the Staff associated with the Rental's StaffID (staff_id).

Generated from foreign key 'rental_staff_id_key'.

func (*Rental) Update

func (r *Rental) Update(db XODB) error

Update updates the Rental in the database.

func (*Rental) Upsert

func (r *Rental) Upsert(db XODB) error

Upsert performs an upsert for Rental.

NOTE: PostgreSQL 9.5+ only

type SalesByFilmCategory

type SalesByFilmCategory struct {
	Category   sql.NullString  `json:"category"`    // category
	TotalSales sql.NullFloat64 `json:"total_sales"` // total_sales
}

SalesByFilmCategory represents a row from 'public.sales_by_film_category'.

type SalesByStore

type SalesByStore struct {
	Store      sql.NullString  `json:"store"`       // store
	Manager    sql.NullString  `json:"manager"`     // manager
	TotalSales sql.NullFloat64 `json:"total_sales"` // total_sales
}

SalesByStore represents a row from 'public.sales_by_store'.

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type Staff

type Staff struct {
	StaffID    int            `json:"staff_id"`    // staff_id
	FirstName  string         `json:"first_name"`  // first_name
	LastName   string         `json:"last_name"`   // last_name
	AddressID  int16          `json:"address_id"`  // address_id
	Email      sql.NullString `json:"email"`       // email
	StoreID    int16          `json:"store_id"`    // store_id
	Active     bool           `json:"active"`      // active
	Username   string         `json:"username"`    // username
	Password   sql.NullString `json:"password"`    // password
	LastUpdate time.Time      `json:"last_update"` // last_update
	Picture    []byte         `json:"picture"`     // picture
	// contains filtered or unexported fields
}

Staff represents a row from 'public.staff'.

func StaffByStaffID

func StaffByStaffID(db XODB, staffID int) (*Staff, error)

StaffByStaffID retrieves a row from 'public.staff' as a Staff.

Generated from index 'staff_pkey'.

func (*Staff) Address

func (s *Staff) Address(db XODB) (*Address, error)

Address returns the Address associated with the Staff's AddressID (address_id).

Generated from foreign key 'staff_address_id_fkey'.

func (*Staff) Delete

func (s *Staff) Delete(db XODB) error

Delete deletes the Staff from the database.

func (*Staff) Deleted

func (s *Staff) Deleted() bool

Deleted provides information if the Staff has been deleted from the database.

func (*Staff) Exists

func (s *Staff) Exists() bool

Exists determines if the Staff exists in the database.

func (*Staff) Insert

func (s *Staff) Insert(db XODB) error

Insert inserts the Staff to the database.

func (*Staff) Save

func (s *Staff) Save(db XODB) error

Save saves the Staff to the database.

func (*Staff) Update

func (s *Staff) Update(db XODB) error

Update updates the Staff in the database.

func (*Staff) Upsert

func (s *Staff) Upsert(db XODB) error

Upsert performs an upsert for Staff.

NOTE: PostgreSQL 9.5+ only

type StaffList

type StaffList struct {
	ID      sql.NullInt64  `json:"id"`       // id
	Name    sql.NullString `json:"name"`     // name
	Address sql.NullString `json:"address"`  // address
	ZipCode sql.NullString `json:"zip code"` // zip code
	Phone   sql.NullString `json:"phone"`    // phone
	City    sql.NullString `json:"city"`     // city
	Country sql.NullString `json:"country"`  // country
	Sid     sql.NullInt64  `json:"sid"`      // sid
}

StaffList represents a row from 'public.staff_list'.

type Store

type Store struct {
	StoreID        int       `json:"store_id"`         // store_id
	ManagerStaffID int16     `json:"manager_staff_id"` // manager_staff_id
	AddressID      int16     `json:"address_id"`       // address_id
	LastUpdate     time.Time `json:"last_update"`      // last_update
	// contains filtered or unexported fields
}

Store represents a row from 'public.store'.

func StoreByManagerStaffID

func StoreByManagerStaffID(db XODB, managerStaffID int16) (*Store, error)

StoreByManagerStaffID retrieves a row from 'public.store' as a Store.

Generated from index 'idx_unq_manager_staff_id'.

func StoreByStoreID

func StoreByStoreID(db XODB, storeID int) (*Store, error)

StoreByStoreID retrieves a row from 'public.store' as a Store.

Generated from index 'store_pkey'.

func (*Store) Address

func (s *Store) Address(db XODB) (*Address, error)

Address returns the Address associated with the Store's AddressID (address_id).

Generated from foreign key 'store_address_id_fkey'.

func (*Store) Delete

func (s *Store) Delete(db XODB) error

Delete deletes the Store from the database.

func (*Store) Deleted

func (s *Store) Deleted() bool

Deleted provides information if the Store has been deleted from the database.

func (*Store) Exists

func (s *Store) Exists() bool

Exists determines if the Store exists in the database.

func (*Store) Insert

func (s *Store) Insert(db XODB) error

Insert inserts the Store to the database.

func (*Store) Save

func (s *Store) Save(db XODB) error

Save saves the Store to the database.

func (*Store) Staff

func (s *Store) Staff(db XODB) (*Staff, error)

Staff returns the Staff associated with the Store's ManagerStaffID (manager_staff_id).

Generated from foreign key 'store_manager_staff_id_fkey'.

func (*Store) Update

func (s *Store) Update(db XODB) error

Update updates the Store in the database.

func (*Store) Upsert

func (s *Store) Upsert(db XODB) error

Upsert performs an upsert for Store.

NOTE: PostgreSQL 9.5+ only

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

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