schema

package
v0.0.0-...-8b1ae4f Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchiveColumns = struct {
	ID             string
	DeviceID       string
	ArchiveEventID string
	ContentType    string
}{
	ID:             "id",
	DeviceID:       "device_id",
	ArchiveEventID: "archive_event_id",
	ContentType:    "content_type",
}
View Source
var ArchiveEventColumns = struct {
	ID          string
	DeviceID    string
	ClientID    string
	RequestedAt string
}{
	ID:          "id",
	DeviceID:    "device_id",
	ClientID:    "client_id",
	RequestedAt: "requested_at",
}
View Source
var ArchiveEventRels = struct {
}{}

ArchiveEventRels is where relationship names are stored.

View Source
var ArchiveEventTableColumns = struct {
	ID          string
	DeviceID    string
	ClientID    string
	RequestedAt string
}{
	ID:          "archive_event.id",
	DeviceID:    "archive_event.device_id",
	ClientID:    "archive_event.client_id",
	RequestedAt: "archive_event.requested_at",
}
View Source
var ArchiveEventWhere = struct {
	ID          whereHelperstring
	DeviceID    whereHelperstring
	ClientID    whereHelperstring
	RequestedAt whereHelpertime_Time
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	DeviceID:    whereHelperstring{/* contains filtered or unexported fields */},
	ClientID:    whereHelperstring{/* contains filtered or unexported fields */},
	RequestedAt: whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var ArchiveRels = struct {
	Device string
}{
	Device: "Device",
}

ArchiveRels is where relationship names are stored.

View Source
var ArchiveTableColumns = struct {
	ID             string
	DeviceID       string
	ArchiveEventID string
	ContentType    string
}{
	ID:             "archive.id",
	DeviceID:       "archive.device_id",
	ArchiveEventID: "archive.archive_event_id",
	ContentType:    "archive.content_type",
}
View Source
var ArchiveWhere = struct {
	ID             whereHelperstring
	DeviceID       whereHelperstring
	ArchiveEventID whereHelperstring
	ContentType    whereHelperstring
}{
	ID:             whereHelperstring{/* contains filtered or unexported fields */},
	DeviceID:       whereHelperstring{/* contains filtered or unexported fields */},
	ArchiveEventID: whereHelperstring{/* contains filtered or unexported fields */},
	ContentType:    whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ClientColumns = struct {
	ID     string
	Name   string
	Secret string
}{
	ID:     "id",
	Name:   "name",
	Secret: "secret",
}
View Source
var ClientRels = struct {
	Devices string
}{
	Devices: "Devices",
}

ClientRels is where relationship names are stored.

View Source
var ClientTableColumns = struct {
	ID     string
	Name   string
	Secret string
}{
	ID:     "client.id",
	Name:   "client.name",
	Secret: "client.secret",
}
View Source
var ClientWhere = struct {
	ID     whereHelperstring
	Name   whereHelperstring
	Secret whereHelperstring
}{
	ID:     whereHelperstring{/* contains filtered or unexported fields */},
	Name:   whereHelperstring{/* contains filtered or unexported fields */},
	Secret: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var DeviceColumns = struct {
	ID        string
	Name      string
	Secret    string
	ClientID  string
	IsDeleted string
}{
	ID:        "id",
	Name:      "name",
	Secret:    "secret",
	ClientID:  "client_id",
	IsDeleted: "is_deleted",
}
View Source
var DeviceRels = struct {
	Client   string
	Archives string
}{
	Client:   "Client",
	Archives: "Archives",
}

DeviceRels is where relationship names are stored.

View Source
var DeviceTableColumns = struct {
	ID        string
	Name      string
	Secret    string
	ClientID  string
	IsDeleted string
}{
	ID:        "device.id",
	Name:      "device.name",
	Secret:    "device.secret",
	ClientID:  "device.client_id",
	IsDeleted: "device.is_deleted",
}
View Source
var DeviceWhere = struct {
	ID        whereHelperstring
	Name      whereHelperstring
	Secret    whereHelperstring
	ClientID  whereHelperstring
	IsDeleted whereHelpernull_Bool
}{
	ID:        whereHelperstring{/* contains filtered or unexported fields */},
	Name:      whereHelperstring{/* contains filtered or unexported fields */},
	Secret:    whereHelperstring{/* contains filtered or unexported fields */},
	ClientID:  whereHelperstring{/* contains filtered or unexported fields */},
	IsDeleted: whereHelpernull_Bool{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("schema: 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 {
	Archive      string
	ArchiveEvent string
	Client       string
	Device       string
}{
	Archive:      "archive",
	ArchiveEvent: "archive_event",
	Client:       "client",
	Device:       "device",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddArchiveEventHook

func AddArchiveEventHook(hookPoint boil.HookPoint, archiveEventHook ArchiveEventHook)

AddArchiveEventHook registers your hook function for all future operations.

func AddArchiveHook

func AddArchiveHook(hookPoint boil.HookPoint, archiveHook ArchiveHook)

AddArchiveHook registers your hook function for all future operations.

func AddClientHook

func AddClientHook(hookPoint boil.HookPoint, clientHook ClientHook)

AddClientHook registers your hook function for all future operations.

func AddDeviceHook

func AddDeviceHook(hookPoint boil.HookPoint, deviceHook DeviceHook)

AddDeviceHook registers your hook function for all future operations.

func ArchiveEventExists

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

ArchiveEventExists checks if the ArchiveEvent row exists.

func ArchiveEvents

func ArchiveEvents(mods ...qm.QueryMod) archiveEventQuery

ArchiveEvents retrieves all the records using an executor.

func ArchiveExists

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

ArchiveExists checks if the Archive row exists.

func Archives

func Archives(mods ...qm.QueryMod) archiveQuery

Archives retrieves all the records using an executor.

func ClientExists

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

ClientExists checks if the Client row exists.

func Clients

func Clients(mods ...qm.QueryMod) clientQuery

Clients retrieves all the records using an executor.

func DeviceExists

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

DeviceExists checks if the Device row exists.

func Devices

func Devices(mods ...qm.QueryMod) deviceQuery

Devices retrieves all the records using an executor.

func NewQuery

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

NewQuery initializes a new Query using the passed in QueryMods

Types

type Archive

type Archive struct {
	ID             string `boil:"id" json:"id" toml:"id" yaml:"id"`
	DeviceID       string `boil:"device_id" json:"device_id" toml:"device_id" yaml:"device_id"`
	ArchiveEventID string `boil:"archive_event_id" json:"archive_event_id" toml:"archive_event_id" yaml:"archive_event_id"`
	ContentType    string `boil:"content_type" json:"content_type" toml:"content_type" yaml:"content_type"`

	R *archiveR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L archiveL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Archive is an object representing the database table.

func FindArchive

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

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

func (*Archive) Delete

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

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

func (*Archive) Device

func (o *Archive) Device(mods ...qm.QueryMod) deviceQuery

Device pointed to by the foreign key.

func (*Archive) Exists

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

Exists checks if the Archive row exists.

func (*Archive) Insert

func (o *Archive) 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 (*Archive) Reload

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

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

func (*Archive) SetDevice

func (o *Archive) SetDevice(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Device) error

SetDevice of the archive to the related item. Sets o.R.Device to related. Adds o to related.R.Archives.

func (*Archive) Update

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

Update uses an executor to update the Archive. 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 (*Archive) Upsert

func (o *Archive) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ArchiveEvent

type ArchiveEvent struct {
	ID          string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	DeviceID    string    `boil:"device_id" json:"device_id" toml:"device_id" yaml:"device_id"`
	ClientID    string    `boil:"client_id" json:"client_id" toml:"client_id" yaml:"client_id"`
	RequestedAt time.Time `boil:"requested_at" json:"requested_at" toml:"requested_at" yaml:"requested_at"`

	R *archiveEventR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L archiveEventL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ArchiveEvent is an object representing the database table.

func FindArchiveEvent

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

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

func (*ArchiveEvent) Delete

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

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

func (*ArchiveEvent) Exists

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

Exists checks if the ArchiveEvent row exists.

func (*ArchiveEvent) Insert

func (o *ArchiveEvent) 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 (*ArchiveEvent) Reload

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

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

func (*ArchiveEvent) Update

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

Update uses an executor to update the ArchiveEvent. 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 (*ArchiveEvent) Upsert

func (o *ArchiveEvent) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ArchiveEventHook

type ArchiveEventHook func(context.Context, boil.ContextExecutor, *ArchiveEvent) error

ArchiveEventHook is the signature for custom ArchiveEvent hook methods

type ArchiveEventSlice

type ArchiveEventSlice []*ArchiveEvent

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

func (ArchiveEventSlice) DeleteAll

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

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

func (*ArchiveEventSlice) ReloadAll

func (o *ArchiveEventSlice) 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 (ArchiveEventSlice) UpdateAll

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

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

type ArchiveHook

type ArchiveHook func(context.Context, boil.ContextExecutor, *Archive) error

ArchiveHook is the signature for custom Archive hook methods

type ArchiveSlice

type ArchiveSlice []*Archive

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

func (ArchiveSlice) DeleteAll

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

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

func (*ArchiveSlice) ReloadAll

func (o *ArchiveSlice) 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 (ArchiveSlice) UpdateAll

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

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

type Client

type Client struct {
	ID     string `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name   string `boil:"name" json:"name" toml:"name" yaml:"name"`
	Secret string `boil:"secret" json:"secret" toml:"secret" yaml:"secret"`

	R *clientR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L clientL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Client is an object representing the database table.

func FindClient

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

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

func (*Client) AddDevices

func (o *Client) AddDevices(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Device) error

AddDevices adds the given related objects to the existing relationships of the client, optionally inserting them as new records. Appends related to o.R.Devices. Sets related.R.Client appropriately.

func (*Client) Delete

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

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

func (*Client) Devices

func (o *Client) Devices(mods ...qm.QueryMod) deviceQuery

Devices retrieves all the device's Devices with an executor.

func (*Client) Exists

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

Exists checks if the Client row exists.

func (*Client) Insert

func (o *Client) 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 (*Client) Reload

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

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

func (*Client) Update

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

Update uses an executor to update the Client. 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 (*Client) Upsert

func (o *Client) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ClientHook

type ClientHook func(context.Context, boil.ContextExecutor, *Client) error

ClientHook is the signature for custom Client hook methods

type ClientSlice

type ClientSlice []*Client

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

func (ClientSlice) DeleteAll

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

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

func (*ClientSlice) ReloadAll

func (o *ClientSlice) 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 (ClientSlice) UpdateAll

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

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

type Device

type Device struct {
	ID        string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name      string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Secret    string    `boil:"secret" json:"secret" toml:"secret" yaml:"secret"`
	ClientID  string    `boil:"client_id" json:"client_id" toml:"client_id" yaml:"client_id"`
	IsDeleted null.Bool `boil:"is_deleted" json:"is_deleted,omitempty" toml:"is_deleted" yaml:"is_deleted,omitempty"`

	R *deviceR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L deviceL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Device is an object representing the database table.

func FindDevice

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

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

func (*Device) AddArchives

func (o *Device) AddArchives(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Archive) error

AddArchives adds the given related objects to the existing relationships of the device, optionally inserting them as new records. Appends related to o.R.Archives. Sets related.R.Device appropriately.

func (*Device) Archives

func (o *Device) Archives(mods ...qm.QueryMod) archiveQuery

Archives retrieves all the archive's Archives with an executor.

func (*Device) Client

func (o *Device) Client(mods ...qm.QueryMod) clientQuery

Client pointed to by the foreign key.

func (*Device) Delete

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

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

func (*Device) Exists

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

Exists checks if the Device row exists.

func (*Device) Insert

func (o *Device) 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 (*Device) Reload

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

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

func (*Device) SetClient

func (o *Device) SetClient(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Client) error

SetClient of the device to the related item. Sets o.R.Client to related. Adds o to related.R.Devices.

func (*Device) Update

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

Update uses an executor to update the Device. 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 (*Device) Upsert

func (o *Device) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 DeviceHook

type DeviceHook func(context.Context, boil.ContextExecutor, *Device) error

DeviceHook is the signature for custom Device hook methods

type DeviceSlice

type DeviceSlice []*Device

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

func (DeviceSlice) DeleteAll

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

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

func (*DeviceSlice) ReloadAll

func (o *DeviceSlice) 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 (DeviceSlice) UpdateAll

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

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

type M

type M map[string]interface{}

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

Jump to

Keyboard shortcuts

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