models

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

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 16 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 FileColumns = struct {
	ID          string
	TenantId    string
	Created     string
	Modified    string
	Active      string
	Deleted     string
	UploadError string
}{
	ID:          "id",
	TenantId:    "tenantId",
	Created:     "created",
	Modified:    "modified",
	Active:      "active",
	Deleted:     "deleted",
	UploadError: "uploadError",
}
View Source
var FileRels = struct {
	TenantIdTenant string
}{
	TenantIdTenant: "TenantIdTenant",
}

FileRels is where relationship names are stored.

View Source
var FileTableColumns = struct {
	ID          string
	TenantId    string
	Created     string
	Modified    string
	Active      string
	Deleted     string
	UploadError string
}{
	ID:          "file.id",
	TenantId:    "file.tenantId",
	Created:     "file.created",
	Modified:    "file.modified",
	Active:      "file.active",
	Deleted:     "file.deleted",
	UploadError: "file.uploadError",
}
View Source
var FileWhere = struct {
	ID          whereHelperstring
	TenantId    whereHelperstring
	Created     whereHelpertime_Time
	Modified    whereHelpertime_Time
	Active      whereHelperbool
	Deleted     whereHelperbool
	UploadError whereHelperbool
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	TenantId:    whereHelperstring{/* contains filtered or unexported fields */},
	Created:     whereHelpertime_Time{/* contains filtered or unexported fields */},
	Modified:    whereHelpertime_Time{/* contains filtered or unexported fields */},
	Active:      whereHelperbool{/* contains filtered or unexported fields */},
	Deleted:     whereHelperbool{/* contains filtered or unexported fields */},
	UploadError: whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	File   string
	Tenant string
}{
	File:   "file",
	Tenant: "tenant",
}
View Source
var TenantColumns = struct {
	ID       string
	ApiKey   string
	Name     string
	Created  string
	Modified string
	Active   string
}{
	ID:       "id",
	ApiKey:   "apiKey",
	Name:     "name",
	Created:  "created",
	Modified: "modified",
	Active:   "active",
}
View Source
var TenantRels = struct {
	TenantIdFiles string
}{
	TenantIdFiles: "TenantIdFiles",
}

TenantRels is where relationship names are stored.

View Source
var TenantTableColumns = struct {
	ID       string
	ApiKey   string
	Name     string
	Created  string
	Modified string
	Active   string
}{
	ID:       "tenant.id",
	ApiKey:   "tenant.apiKey",
	Name:     "tenant.name",
	Created:  "tenant.created",
	Modified: "tenant.modified",
	Active:   "tenant.active",
}
View Source
var TenantWhere = struct {
	ID       whereHelperstring
	ApiKey   whereHelperstring
	Name     whereHelperstring
	Created  whereHelpertime_Time
	Modified whereHelpertime_Time
	Active   whereHelperbool
}{
	ID:       whereHelperstring{/* contains filtered or unexported fields */},
	ApiKey:   whereHelperstring{/* contains filtered or unexported fields */},
	Name:     whereHelperstring{/* contains filtered or unexported fields */},
	Created:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	Modified: whereHelpertime_Time{/* contains filtered or unexported fields */},
	Active:   whereHelperbool{/* contains filtered or unexported fields */},
}
View Source
var ViewNames = struct {
}{}

Functions

func AddFileHook

func AddFileHook(hookPoint boil.HookPoint, fileHook FileHook)

AddFileHook registers your hook function for all future operations.

func AddTenantHook

func AddTenantHook(hookPoint boil.HookPoint, tenantHook TenantHook)

AddTenantHook registers your hook function for all future operations.

func FileExists

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

FileExists checks if the File row exists.

func Files

func Files(mods ...qm.QueryMod) fileQuery

Files 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

func TenantExists

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

TenantExists checks if the Tenant row exists.

func Tenants

func Tenants(mods ...qm.QueryMod) tenantQuery

Tenants retrieves all the records using an executor.

Types

type File

type File struct {
	ID          string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	TenantId    string    `boil:"tenantId" json:"tenantId" toml:"tenantId" yaml:"tenantId"`
	Created     time.Time `boil:"created" json:"created" toml:"created" yaml:"created"`
	Modified    time.Time `boil:"modified" json:"modified" toml:"modified" yaml:"modified"`
	Active      bool      `boil:"active" json:"active" toml:"active" yaml:"active"`
	Deleted     bool      `boil:"deleted" json:"deleted" toml:"deleted" yaml:"deleted"`
	UploadError bool      `boil:"uploadError" json:"uploadError" toml:"uploadError" yaml:"uploadError"`

	R *fileR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L fileL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

File is an object representing the database table.

func FindFile

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

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

func (*File) Delete

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

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

func (*File) Exists

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

Exists checks if the File row exists.

func (*File) Insert

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

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

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

func (*File) SetTenantIdTenant

func (o *File) SetTenantIdTenant(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Tenant) error

SetTenantIdTenant of the file to the related item. Sets o.R.TenantIdTenant to related. Adds o to related.R.TenantIdFiles.

func (*File) TenantIdTenant

func (o *File) TenantIdTenant(mods ...qm.QueryMod) tenantQuery

TenantIdTenant pointed to by the foreign key.

func (*File) Update

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

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

func (o *File) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) 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 FileHook

type FileHook func(context.Context, boil.ContextExecutor, *File) error

FileHook is the signature for custom File hook methods

type FileSlice

type FileSlice []*File

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

func (FileSlice) DeleteAll

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

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

func (*FileSlice) ReloadAll

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

func (o FileSlice) 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.

type Tenant

type Tenant struct {
	ID       string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	ApiKey   string    `boil:"apiKey" json:"apiKey" toml:"apiKey" yaml:"apiKey"`
	Name     string    `boil:"name" json:"name" toml:"name" yaml:"name"`
	Created  time.Time `boil:"created" json:"created" toml:"created" yaml:"created"`
	Modified time.Time `boil:"modified" json:"modified" toml:"modified" yaml:"modified"`
	Active   bool      `boil:"active" json:"active" toml:"active" yaml:"active"`

	R *tenantR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tenantL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Tenant is an object representing the database table.

func FindTenant

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

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

func (*Tenant) AddTenantIdFiles

func (o *Tenant) AddTenantIdFiles(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*File) error

AddTenantIdFiles adds the given related objects to the existing relationships of the tenant, optionally inserting them as new records. Appends related to o.R.TenantIdFiles. Sets related.R.TenantIdTenant appropriately.

func (*Tenant) Delete

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

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

func (*Tenant) Exists

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

Exists checks if the Tenant row exists.

func (*Tenant) Insert

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

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

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

func (*Tenant) TenantIdFiles

func (o *Tenant) TenantIdFiles(mods ...qm.QueryMod) fileQuery

TenantIdFiles retrieves all the file's Files with an executor via tenantId column.

func (*Tenant) Update

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

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

func (o *Tenant) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) 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 TenantHook

type TenantHook func(context.Context, boil.ContextExecutor, *Tenant) error

TenantHook is the signature for custom Tenant hook methods

type TenantSlice

type TenantSlice []*Tenant

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

func (TenantSlice) DeleteAll

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

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

func (*TenantSlice) ReloadAll

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

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

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

type UpsertOptionFunc

type UpsertOptionFunc func(o *UpsertOptions)

func UpsertConflictTarget

func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc

func UpsertUpdateSet

func UpsertUpdateSet(updateSet string) UpsertOptionFunc

type UpsertOptions

type UpsertOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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