models

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommunityColumns = struct {
	ID         string
	Password   string
	Clients    string
	Persistent string
}{
	ID:         "id",
	Password:   "password",
	Clients:    "clients",
	Persistent: "persistent",
}
View Source
var CommunityRels = struct {
}{}

CommunityRels is where relationship names are stored.

View Source
var CommunityTableColumns = struct {
	ID         string
	Password   string
	Clients    string
	Persistent string
}{
	ID:         "communities.id",
	Password:   "communities.password",
	Clients:    "communities.clients",
	Persistent: "communities.persistent",
}
View Source
var CommunityWhere = struct {
	ID         whereHelperstring
	Password   whereHelperstring
	Clients    whereHelperint
	Persistent whereHelperbool
}{
	ID:         whereHelperstring{/* contains filtered or unexported fields */},
	Password:   whereHelperstring{/* contains filtered or unexported fields */},
	Clients:    whereHelperint{/* contains filtered or unexported fields */},
	Persistent: whereHelperbool{/* contains filtered or unexported fields */},
}
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 GorpMigrationColumns = struct {
	ID        string
	AppliedAt string
}{
	ID:        "id",
	AppliedAt: "applied_at",
}
View Source
var GorpMigrationRels = struct {
}{}

GorpMigrationRels is where relationship names are stored.

View Source
var GorpMigrationTableColumns = struct {
	ID        string
	AppliedAt string
}{
	ID:        "gorp_migrations.id",
	AppliedAt: "gorp_migrations.applied_at",
}
View Source
var GorpMigrationWhere = struct {
	ID        whereHelperstring
	AppliedAt whereHelpernull_Time
}{
	ID:        whereHelperstring{/* contains filtered or unexported fields */},
	AppliedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Communities    string
	GorpMigrations string
}{
	Communities:    "communities",
	GorpMigrations: "gorp_migrations",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddCommunityHook

func AddCommunityHook(hookPoint boil.HookPoint, communityHook CommunityHook)

AddCommunityHook registers your hook function for all future operations.

func AddGorpMigrationHook

func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook)

AddGorpMigrationHook registers your hook function for all future operations.

func Communities

func Communities(mods ...qm.QueryMod) communityQuery

Communities retrieves all the records using an executor.

func CommunityExists

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

CommunityExists checks if the Community row exists.

func GorpMigrationExists

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

GorpMigrationExists checks if the GorpMigration row exists.

func GorpMigrations

func GorpMigrations(mods ...qm.QueryMod) gorpMigrationQuery

GorpMigrations 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 Community

type Community struct {
	ID         string `boil:"id" json:"id" toml:"id" yaml:"id"`
	Password   string `boil:"password" json:"password" toml:"password" yaml:"password"`
	Clients    int    `boil:"clients" json:"clients" toml:"clients" yaml:"clients"`
	Persistent bool   `boil:"persistent" json:"persistent" toml:"persistent" yaml:"persistent"`

	R *communityR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L communityL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Community is an object representing the database table.

func FindCommunity

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

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

func (*Community) Delete

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

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

func (*Community) Exists added in v0.2.7

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

Exists checks if the Community row exists.

func (*Community) Insert

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

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

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

func (*Community) Update

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

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

func (o *Community) 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 CommunityHook

type CommunityHook func(context.Context, boil.ContextExecutor, *Community) error

CommunityHook is the signature for custom Community hook methods

type CommunitySlice

type CommunitySlice []*Community

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

func (CommunitySlice) DeleteAll

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

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

func (*CommunitySlice) ReloadAll

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

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

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

type GorpMigration

type GorpMigration struct {
	ID        string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	AppliedAt null.Time `boil:"applied_at" json:"applied_at,omitempty" toml:"applied_at" yaml:"applied_at,omitempty"`

	R *gorpMigrationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L gorpMigrationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

GorpMigration is an object representing the database table.

func FindGorpMigration

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

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

func (*GorpMigration) Delete

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

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

func (*GorpMigration) Exists added in v0.2.7

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

Exists checks if the GorpMigration row exists.

func (*GorpMigration) Insert

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

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

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

func (*GorpMigration) Update

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

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

func (o *GorpMigration) 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 GorpMigrationHook

type GorpMigrationHook func(context.Context, boil.ContextExecutor, *GorpMigration) error

GorpMigrationHook is the signature for custom GorpMigration hook methods

type GorpMigrationSlice

type GorpMigrationSlice []*GorpMigration

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

func (GorpMigrationSlice) DeleteAll

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

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

func (*GorpMigrationSlice) ReloadAll

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

func (o GorpMigrationSlice) 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 UpsertOptionFunc added in v0.2.7

type UpsertOptionFunc func(o *UpsertOptions)

func UpsertConflictTarget added in v0.2.7

func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc

func UpsertUpdateSet added in v0.2.7

func UpsertUpdateSet(updateSet string) UpsertOptionFunc

type UpsertOptions added in v0.2.7

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