models

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var TableNames = struct {
	Valuations string
}{
	Valuations: "valuations",
}
View Source
var ValuationColumns = struct {
	ID                    string
	DeviceDefinitionID    string
	Vin                   string
	UserDeviceID          string
	OfferMetadata         string
	EdmundsMetadata       string
	CreatedAt             string
	UpdatedAt             string
	DrivlyPricingMetadata string
	RequestMetadata       string
	VincarioMetadata      string
}{
	ID:                    "id",
	DeviceDefinitionID:    "device_definition_id",
	Vin:                   "vin",
	UserDeviceID:          "user_device_id",
	OfferMetadata:         "offer_metadata",
	EdmundsMetadata:       "edmunds_metadata",
	CreatedAt:             "created_at",
	UpdatedAt:             "updated_at",
	DrivlyPricingMetadata: "drivly_pricing_metadata",
	RequestMetadata:       "request_metadata",
	VincarioMetadata:      "vincario_metadata",
}
View Source
var ValuationRels = struct {
}{}

ValuationRels is where relationship names are stored.

View Source
var ValuationTableColumns = struct {
	ID                    string
	DeviceDefinitionID    string
	Vin                   string
	UserDeviceID          string
	OfferMetadata         string
	EdmundsMetadata       string
	CreatedAt             string
	UpdatedAt             string
	DrivlyPricingMetadata string
	RequestMetadata       string
	VincarioMetadata      string
}{
	ID:                    "valuations.id",
	DeviceDefinitionID:    "valuations.device_definition_id",
	Vin:                   "valuations.vin",
	UserDeviceID:          "valuations.user_device_id",
	OfferMetadata:         "valuations.offer_metadata",
	EdmundsMetadata:       "valuations.edmunds_metadata",
	CreatedAt:             "valuations.created_at",
	UpdatedAt:             "valuations.updated_at",
	DrivlyPricingMetadata: "valuations.drivly_pricing_metadata",
	RequestMetadata:       "valuations.request_metadata",
	VincarioMetadata:      "valuations.vincario_metadata",
}
View Source
var ValuationWhere = struct {
	ID                    whereHelperstring
	DeviceDefinitionID    whereHelpernull_String
	Vin                   whereHelperstring
	UserDeviceID          whereHelpernull_String
	OfferMetadata         whereHelpernull_JSON
	EdmundsMetadata       whereHelpernull_JSON
	CreatedAt             whereHelpertime_Time
	UpdatedAt             whereHelpertime_Time
	DrivlyPricingMetadata whereHelpernull_JSON
	RequestMetadata       whereHelpernull_JSON
	VincarioMetadata      whereHelpernull_JSON
}{
	ID:                    whereHelperstring{/* contains filtered or unexported fields */},
	DeviceDefinitionID:    whereHelpernull_String{/* contains filtered or unexported fields */},
	Vin:                   whereHelperstring{/* contains filtered or unexported fields */},
	UserDeviceID:          whereHelpernull_String{/* contains filtered or unexported fields */},
	OfferMetadata:         whereHelpernull_JSON{/* contains filtered or unexported fields */},
	EdmundsMetadata:       whereHelpernull_JSON{/* contains filtered or unexported fields */},
	CreatedAt:             whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:             whereHelpertime_Time{/* contains filtered or unexported fields */},
	DrivlyPricingMetadata: whereHelpernull_JSON{/* contains filtered or unexported fields */},
	RequestMetadata:       whereHelpernull_JSON{/* contains filtered or unexported fields */},
	VincarioMetadata:      whereHelpernull_JSON{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddValuationHook

func AddValuationHook(hookPoint boil.HookPoint, valuationHook ValuationHook)

AddValuationHook registers your hook function for all future operations.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func ValuationExists

func ValuationExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

ValuationExists checks if the Valuation row exists.

func Valuations

func Valuations(mods ...qm.QueryMod) valuationQuery

Valuations retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type Valuation

type Valuation struct {
	ID                    string      `boil:"id" json:"id" toml:"id" yaml:"id"`
	DeviceDefinitionID    null.String `` /* 131-byte string literal not displayed */
	Vin                   string      `boil:"vin" json:"vin" toml:"vin" yaml:"vin"`
	UserDeviceID          null.String `boil:"user_device_id" json:"user_device_id,omitempty" toml:"user_device_id" yaml:"user_device_id,omitempty"`
	OfferMetadata         null.JSON   `boil:"offer_metadata" json:"offer_metadata,omitempty" toml:"offer_metadata" yaml:"offer_metadata,omitempty"`
	EdmundsMetadata       null.JSON   `boil:"edmunds_metadata" json:"edmunds_metadata,omitempty" toml:"edmunds_metadata" yaml:"edmunds_metadata,omitempty"`
	CreatedAt             time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt             time.Time   `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	DrivlyPricingMetadata null.JSON   `` /* 143-byte string literal not displayed */
	RequestMetadata       null.JSON   `boil:"request_metadata" json:"request_metadata,omitempty" toml:"request_metadata" yaml:"request_metadata,omitempty"`
	VincarioMetadata      null.JSON   `boil:"vincario_metadata" json:"vincario_metadata,omitempty" toml:"vincario_metadata" yaml:"vincario_metadata,omitempty"`

	R *valuationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L valuationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Valuation is an object representing the database table.

func FindValuation

func FindValuation(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Valuation, error)

FindValuation retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Valuation) Delete

func (o *Valuation) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Valuation record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Valuation) Exists added in v0.1.1

func (o *Valuation) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)

Exists checks if the Valuation row exists.

func (*Valuation) Insert

func (o *Valuation) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Valuation) Reload

func (o *Valuation) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Valuation) Update

func (o *Valuation) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Valuation. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Valuation) Upsert

func (o *Valuation) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type ValuationHook

type ValuationHook func(context.Context, boil.ContextExecutor, *Valuation) error

ValuationHook is the signature for custom Valuation hook methods

type ValuationSlice

type ValuationSlice []*Valuation

ValuationSlice is an alias for a slice of pointers to Valuation. This should almost always be used instead of []Valuation.

func (ValuationSlice) DeleteAll

func (o ValuationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*ValuationSlice) ReloadAll

func (o *ValuationSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (ValuationSlice) UpdateAll

func (o ValuationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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