Documentation
¶
Index ¶
- Variables
- func DeviceLocationExists(ctx context.Context, exec bob.Executor, TimePK time.Time, DeviceIDPK string) (bool, error)
- func SchemaMigrationExists(ctx context.Context, exec bob.Executor, VersionPK string) (bool, error)
- func Where[Q psql.Filterable]() struct{ ... }
- type DeviceLocation
- func (o *DeviceLocation) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
- func (o *DeviceLocation) Delete(ctx context.Context, exec bob.Executor) error
- func (o *DeviceLocation) Reload(ctx context.Context, exec bob.Executor) error
- func (o *DeviceLocation) Update(ctx context.Context, exec bob.Executor, s *DeviceLocationSetter) error
- type DeviceLocationSetter
- func (s *DeviceLocationSetter) Apply(q *dialect.InsertQuery)
- func (s DeviceLocationSetter) Expressions(prefix ...string) []bob.Expression
- func (s DeviceLocationSetter) Overwrite(t *DeviceLocation)
- func (s DeviceLocationSetter) SetColumns() []string
- func (s DeviceLocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
- type DeviceLocationSlice
- func (o DeviceLocationSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
- func (o DeviceLocationSlice) DeleteAll(ctx context.Context, exec bob.Executor) error
- func (o DeviceLocationSlice) DeleteMod() bob.Mod[*dialect.DeleteQuery]
- func (o DeviceLocationSlice) ReloadAll(ctx context.Context, exec bob.Executor) error
- func (o DeviceLocationSlice) UpdateAll(ctx context.Context, exec bob.Executor, vals DeviceLocationSetter) error
- func (o DeviceLocationSlice) UpdateMod() bob.Mod[*dialect.UpdateQuery]
- type DeviceLocationsQuery
- type SchemaMigration
- func (o *SchemaMigration) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
- func (o *SchemaMigration) Delete(ctx context.Context, exec bob.Executor) error
- func (o *SchemaMigration) Reload(ctx context.Context, exec bob.Executor) error
- func (o *SchemaMigration) Update(ctx context.Context, exec bob.Executor, s *SchemaMigrationSetter) error
- type SchemaMigrationSetter
- func (s *SchemaMigrationSetter) Apply(q *dialect.InsertQuery)
- func (s SchemaMigrationSetter) Expressions(prefix ...string) []bob.Expression
- func (s SchemaMigrationSetter) Overwrite(t *SchemaMigration)
- func (s SchemaMigrationSetter) SetColumns() []string
- func (s SchemaMigrationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
- type SchemaMigrationSlice
- func (o SchemaMigrationSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
- func (o SchemaMigrationSlice) DeleteAll(ctx context.Context, exec bob.Executor) error
- func (o SchemaMigrationSlice) DeleteMod() bob.Mod[*dialect.DeleteQuery]
- func (o SchemaMigrationSlice) ReloadAll(ctx context.Context, exec bob.Executor) error
- func (o SchemaMigrationSlice) UpdateAll(ctx context.Context, exec bob.Executor, vals SchemaMigrationSetter) error
- func (o SchemaMigrationSlice) UpdateMod() bob.Mod[*dialect.UpdateQuery]
- type SchemaMigrationsQuery
Constants ¶
This section is empty.
Variables ¶
var ( SelectJoins = getJoins[*dialect.SelectQuery]() UpdateJoins = getJoins[*dialect.UpdateQuery]() DeleteJoins = getJoins[*dialect.DeleteQuery]() )
var ( SelectThenLoad = getThenLoaders[*dialect.SelectQuery]() InsertThenLoad = getThenLoaders[*dialect.InsertQuery]() UpdateThenLoad = getThenLoaders[*dialect.UpdateQuery]() )
var ( SelectWhere = Where[*dialect.SelectQuery]() UpdateWhere = Where[*dialect.UpdateQuery]() DeleteWhere = Where[*dialect.DeleteQuery]() OnConflictWhere = Where[*clause.ConflictClause]() // Used in ON CONFLICT DO UPDATE )
var DeviceLocations = psql.NewTablex[*DeviceLocation, DeviceLocationSlice, *DeviceLocationSetter]("", "device_locations", buildDeviceLocationColumns("device_locations"))
DeviceLocations contains methods to work with the device_locations table
var Preload = getPreloaders()
var SchemaMigrations = psql.NewTablex[*SchemaMigration, SchemaMigrationSlice, *SchemaMigrationSetter]("", "schema_migrations", buildSchemaMigrationColumns("schema_migrations"))
SchemaMigrations contains methods to work with the schema_migrations table
Functions ¶
func DeviceLocationExists ¶
func DeviceLocationExists(ctx context.Context, exec bob.Executor, TimePK time.Time, DeviceIDPK string) (bool, error)
DeviceLocationExists checks the presence of a single record by primary key
func SchemaMigrationExists ¶
SchemaMigrationExists checks the presence of a single record by primary key
func Where ¶
func Where[Q psql.Filterable]() struct { DeviceLocations deviceLocationWhere[Q] SchemaMigrations schemaMigrationWhere[Q] }
Types ¶
type DeviceLocation ¶
type DeviceLocation struct {
Time time.Time `db:"time,pk" `
DeviceID string `db:"device_id,pk" `
SpaceSlug string `db:"space_slug" `
Latitude float64 `db:"latitude" `
Longitude float64 `db:"longitude" `
Accuracy float64 `db:"accuracy" `
}
DeviceLocation is an object representing the database table.
func FindDeviceLocation ¶
func FindDeviceLocation(ctx context.Context, exec bob.Executor, TimePK time.Time, DeviceIDPK string, cols ...string) (*DeviceLocation, error)
FindDeviceLocation retrieves a single record by primary key If cols is empty Find will return all columns.
func (*DeviceLocation) AfterQueryHook ¶
func (o *DeviceLocation) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
AfterQueryHook is called after DeviceLocation is retrieved from the database
func (*DeviceLocation) Update ¶
func (o *DeviceLocation) Update(ctx context.Context, exec bob.Executor, s *DeviceLocationSetter) error
Update uses an executor to update the DeviceLocation
type DeviceLocationSetter ¶
type DeviceLocationSetter struct {
Time omit.Val[time.Time] `db:"time,pk" `
DeviceID omit.Val[string] `db:"device_id,pk" `
SpaceSlug omit.Val[string] `db:"space_slug" `
Latitude omit.Val[float64] `db:"latitude" `
Longitude omit.Val[float64] `db:"longitude" `
Accuracy omit.Val[float64] `db:"accuracy" `
}
DeviceLocationSetter is used for insert/upsert/update operations All values are optional, and do not have to be set Generated columns are not included
func (*DeviceLocationSetter) Apply ¶
func (s *DeviceLocationSetter) Apply(q *dialect.InsertQuery)
func (DeviceLocationSetter) Expressions ¶
func (s DeviceLocationSetter) Expressions(prefix ...string) []bob.Expression
func (DeviceLocationSetter) Overwrite ¶
func (s DeviceLocationSetter) Overwrite(t *DeviceLocation)
func (DeviceLocationSetter) SetColumns ¶
func (s DeviceLocationSetter) SetColumns() []string
func (DeviceLocationSetter) UpdateMod ¶
func (s DeviceLocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
type DeviceLocationSlice ¶
type DeviceLocationSlice []*DeviceLocation
DeviceLocationSlice is an alias for a slice of pointers to DeviceLocation. This should almost always be used instead of []*DeviceLocation.
func (DeviceLocationSlice) AfterQueryHook ¶
func (o DeviceLocationSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
AfterQueryHook is called after DeviceLocationSlice is retrieved from the database
func (DeviceLocationSlice) DeleteMod ¶
func (o DeviceLocationSlice) DeleteMod() bob.Mod[*dialect.DeleteQuery]
DeleteMod modifies an delete query with "WHERE primary_key IN (o...)"
func (DeviceLocationSlice) UpdateAll ¶
func (o DeviceLocationSlice) UpdateAll(ctx context.Context, exec bob.Executor, vals DeviceLocationSetter) error
func (DeviceLocationSlice) UpdateMod ¶
func (o DeviceLocationSlice) UpdateMod() bob.Mod[*dialect.UpdateQuery]
UpdateMod modifies an update query with "WHERE primary_key IN (o...)"
type DeviceLocationsQuery ¶
type DeviceLocationsQuery = *psql.ViewQuery[*DeviceLocation, DeviceLocationSlice]
DeviceLocationsQuery is a query on the device_locations table
type SchemaMigration ¶
type SchemaMigration struct {
Version string `db:"version,pk" `
}
SchemaMigration is an object representing the database table.
func FindSchemaMigration ¶
func FindSchemaMigration(ctx context.Context, exec bob.Executor, VersionPK string, cols ...string) (*SchemaMigration, error)
FindSchemaMigration retrieves a single record by primary key If cols is empty Find will return all columns.
func (*SchemaMigration) AfterQueryHook ¶
func (o *SchemaMigration) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
AfterQueryHook is called after SchemaMigration is retrieved from the database
func (*SchemaMigration) Update ¶
func (o *SchemaMigration) Update(ctx context.Context, exec bob.Executor, s *SchemaMigrationSetter) error
Update uses an executor to update the SchemaMigration
type SchemaMigrationSetter ¶
SchemaMigrationSetter is used for insert/upsert/update operations All values are optional, and do not have to be set Generated columns are not included
func (*SchemaMigrationSetter) Apply ¶
func (s *SchemaMigrationSetter) Apply(q *dialect.InsertQuery)
func (SchemaMigrationSetter) Expressions ¶
func (s SchemaMigrationSetter) Expressions(prefix ...string) []bob.Expression
func (SchemaMigrationSetter) Overwrite ¶
func (s SchemaMigrationSetter) Overwrite(t *SchemaMigration)
func (SchemaMigrationSetter) SetColumns ¶
func (s SchemaMigrationSetter) SetColumns() []string
func (SchemaMigrationSetter) UpdateMod ¶
func (s SchemaMigrationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
type SchemaMigrationSlice ¶
type SchemaMigrationSlice []*SchemaMigration
SchemaMigrationSlice is an alias for a slice of pointers to SchemaMigration. This should almost always be used instead of []*SchemaMigration.
func (SchemaMigrationSlice) AfterQueryHook ¶
func (o SchemaMigrationSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error
AfterQueryHook is called after SchemaMigrationSlice is retrieved from the database
func (SchemaMigrationSlice) DeleteMod ¶
func (o SchemaMigrationSlice) DeleteMod() bob.Mod[*dialect.DeleteQuery]
DeleteMod modifies an delete query with "WHERE primary_key IN (o...)"
func (SchemaMigrationSlice) UpdateAll ¶
func (o SchemaMigrationSlice) UpdateAll(ctx context.Context, exec bob.Executor, vals SchemaMigrationSetter) error
func (SchemaMigrationSlice) UpdateMod ¶
func (o SchemaMigrationSlice) UpdateMod() bob.Mod[*dialect.UpdateQuery]
UpdateMod modifies an update query with "WHERE primary_key IN (o...)"
type SchemaMigrationsQuery ¶
type SchemaMigrationsQuery = *psql.ViewQuery[*SchemaMigration, SchemaMigrationSlice]
SchemaMigrationsQuery is a query on the schema_migrations table