model

package
v0.0.0-...-0137e8f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package model contains the types for schema 'amamonitor'.

Package model contains the types for schema 'amamonitor'.

Package model contains the types for schema 'amamonitor'.

Package model contains the types for schema 'amamonitor'.

Index

Constants

View Source
const (
	// ProviderAmaten is the 'amaten' Provider.
	ProviderAmaten = Provider(1)

	// ProviderGiftissue is the 'giftissue' Provider.
	ProviderGiftissue = Provider(2)
)

Variables

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

XOLog provides the log func used by generated queries.

Functions

func ReplaceToTestDBURL

func ReplaceToTestDBURL(dbURL string) string

func Transaction

func Transaction(
	ctx context.Context,
	db *sql.DB,
	txOptions *sql.TxOptions,
	f func(ctx context.Context, tx *sql.Tx) error,
) error

Types

type FetchResult

type FetchResult struct {
	ID        uint      `json:"id"`         // id
	CreatedAt time.Time `json:"created_at"` // created_at
	UpdatedAt time.Time `json:"updated_at"` // updated_at
	// contains filtered or unexported fields
}

FetchResult represents a row from 'fetch_result'.

func FetchResultByID

func FetchResultByID(db XODB, id uint) (*FetchResult, error)

FetchResultByID retrieves a row from 'amamonitor.fetch_result' as a FetchResult.

Generated from index 'fetch_result_id_pkey'.

func (*FetchResult) Delete

func (fr *FetchResult) Delete(db XODB) error

Delete deletes the FetchResult from the database.

func (*FetchResult) Deleted

func (fr *FetchResult) Deleted() bool

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

func (*FetchResult) Exists

func (fr *FetchResult) Exists() bool

Exists determines if the FetchResult exists in the database.

func (*FetchResult) Insert

func (fr *FetchResult) Insert(db XODB) error

Insert inserts the FetchResult to the database.

func (*FetchResult) Save

func (fr *FetchResult) Save(db XODB) error

Save saves the FetchResult to the database.

func (*FetchResult) Update

func (fr *FetchResult) Update(db XODB) error

Update updates the FetchResult in the database.

type GiftItem

type GiftItem struct {
	ID             uint      `json:"id"`              // id
	FetchResultID  uint      `json:"fetch_result_id"` // fetch_result_id
	Provider       Provider  `json:"provider"`        // provider
	SalesPrice     uint      `json:"sales_price"`     // sales_price
	CataloguePrice uint      `json:"catalogue_price"` // catalogue_price
	DiscountRate   float64   `json:"discount_rate"`   // discount_rate
	CreatedAt      time.Time `json:"created_at"`      // created_at
	UpdatedAt      time.Time `json:"updated_at"`      // updated_at
	// contains filtered or unexported fields
}

GiftItem represents a row from 'gift_item'.

func GiftItemByID

func GiftItemByID(db XODB, id uint) (*GiftItem, error)

GiftItemByID retrieves a row from 'amamonitor.gift_item' as a GiftItem.

Generated from index 'gift_item_id_pkey'.

func GiftItemsByFetchResultID

func GiftItemsByFetchResultID(db XODB, fetchResultID uint) ([]*GiftItem, error)

GiftItemsByFetchResultID retrieves a row from 'amamonitor.gift_item' as a GiftItem.

Generated from index 'fetch_result_id'.

func (*GiftItem) Delete

func (gi *GiftItem) Delete(db XODB) error

Delete deletes the GiftItem from the database.

func (*GiftItem) Deleted

func (gi *GiftItem) Deleted() bool

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

func (*GiftItem) Exists

func (gi *GiftItem) Exists() bool

Exists determines if the GiftItem exists in the database.

func (*GiftItem) Insert

func (gi *GiftItem) Insert(db XODB) error

Insert inserts the GiftItem to the database.

func (*GiftItem) Save

func (gi *GiftItem) Save(db XODB) error

Save saves the GiftItem to the database.

func (*GiftItem) Update

func (gi *GiftItem) Update(db XODB) error

Update updates the GiftItem in the database.

type Provider

type Provider uint16

Provider is the 'provider' enum type from schema 'amamonitor'.

func (Provider) MarshalText

func (p Provider) MarshalText() ([]byte, error)

MarshalText marshals Provider into text.

func (*Provider) Scan

func (p *Provider) Scan(src interface{}) error

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

func (Provider) String

func (p Provider) String() string

String returns the string value of the Provider.

func (*Provider) UnmarshalText

func (p *Provider) UnmarshalText(text []byte) error

UnmarshalText unmarshals Provider from text.

func (Provider) Value

func (p Provider) Value() (driver.Value, error)

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

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 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 'amamonitor'.

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