Documentation
¶
Index ¶
- Variables
- func BatchExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func CreateBatch(ctx context.Context, db dbtx, object migration.Batch) (_ int64, _err error)
- func CreateInstance(ctx context.Context, db dbtx, object migration.Instance) (_ int64, _err error)
- func CreateInstanceOverride(ctx context.Context, db dbtx, object migration.InstanceOverride) (_ int64, _err error)
- func CreateNetwork(ctx context.Context, db dbtx, object migration.Network) (_ int64, _err error)
- func CreateSource(ctx context.Context, db dbtx, object migration.Source) (_ int64, _err error)
- func CreateTarget(ctx context.Context, db dbtx, object migration.Target) (_ int64, _err error)
- func DeleteBatch(ctx context.Context, db dbtx, name string) (_err error)
- func DeleteInstance(ctx context.Context, db dbtx, uuid uuid.UUID) (_err error)
- func DeleteInstanceOverride(ctx context.Context, db dbtx, uuid uuid.UUID) (_err error)
- func DeleteNetwork(ctx context.Context, db dbtx, name string) (_err error)
- func DeleteSource(ctx context.Context, db dbtx, name string) (_err error)
- func DeleteTarget(ctx context.Context, db dbtx, name string) (_err error)
- func GetBatch(ctx context.Context, db dbtx, name string) (_ *migration.Batch, _err error)
- func GetBatchID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetBatchNames(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []string, _err error)
- func GetBatches(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []migration.Batch, _err error)
- func GetInstance(ctx context.Context, db dbtx, uuid uuid.UUID) (_ *migration.Instance, _err error)
- func GetInstanceID(ctx context.Context, db tx, uuid uuid.UUID) (_ int64, _err error)
- func GetInstanceNames(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []uuid.UUID, _err error)
- func GetInstanceOverride(ctx context.Context, db dbtx, uuid uuid.UUID) (_ *migration.InstanceOverride, _err error)
- func GetInstanceOverrideID(ctx context.Context, db tx, uuid uuid.UUID) (_ int64, _err error)
- func GetInstanceOverrides(ctx context.Context, db dbtx, filters ...InstanceOverrideFilter) (_ []migration.InstanceOverride, _err error)
- func GetInstances(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []migration.Instance, _err error)
- func GetNetwork(ctx context.Context, db dbtx, name string) (_ *migration.Network, _err error)
- func GetNetworkID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetNetworkNames(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []string, _err error)
- func GetNetworks(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []migration.Network, _err error)
- func GetSource(ctx context.Context, db dbtx, name string) (_ *migration.Source, _err error)
- func GetSourceID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetSourceNames(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []string, _err error)
- func GetSources(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []migration.Source, _err error)
- func GetTarget(ctx context.Context, db dbtx, name string) (_ *migration.Target, _err error)
- func GetTargetID(ctx context.Context, db tx, name string) (_ int64, _err error)
- func GetTargetNames(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []string, _err error)
- func GetTargets(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []migration.Target, _err error)
- func NetworkExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func PrepareStmts(db preparer, skipErrors bool) (map[int]*sql.Stmt, error)
- func RegisterStmt(sqlStmt string) int
- func RenameBatch(ctx context.Context, db dbtx, name string, to string) (_err error)
- func RenameNetwork(ctx context.Context, db dbtx, name string, to string) (_err error)
- func RenameSource(ctx context.Context, db dbtx, name string, to string) (_err error)
- func RenameTarget(ctx context.Context, db dbtx, name string, to string) (_err error)
- func SourceExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func Stmt(db dbtx, code int) (*sql.Stmt, error)
- func StmtString(code int) (string, error)
- func TargetExists(ctx context.Context, db dbtx, name string) (_ bool, _err error)
- func UpdateBatch(ctx context.Context, db tx, name string, object migration.Batch) (_err error)
- func UpdateInstance(ctx context.Context, db tx, uuid uuid.UUID, object migration.Instance) (_err error)
- func UpdateInstanceOverride(ctx context.Context, db tx, uuid uuid.UUID, object migration.InstanceOverride) (_err error)
- func UpdateNetwork(ctx context.Context, db tx, name string, object migration.Network) (_err error)
- func UpdateSource(ctx context.Context, db tx, name string, object migration.Source) (_err error)
- func UpdateTarget(ctx context.Context, db tx, name string, object migration.Target) (_err error)
- type BatchFilter
- type InstanceFilter
- type InstanceOverrideFilter
- type Marshaler
- type NetworkFilter
- type SourceFilter
- type TargetFilter
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is the error returned, if the entity is not found in the DB. ErrNotFound = errors.New("Not found") // ErrConflict is the error returned, if the adding or updating an entity // causes a conflict with an existing entity. ErrConflict = errors.New("Conflict") )
var PreparedStmts = map[int]*sql.Stmt{}
PreparedStmts is a placeholder for transitioning to package-scoped transaction functions.
Functions ¶
func BatchExists ¶
BatchExists checks if a batch with the given key exists. generator: batch Exists
func CreateBatch ¶
CreateBatch adds a new batch to the database. generator: batch Create
func CreateInstance ¶
CreateInstance adds a new instance to the database. generator: instance Create
func CreateInstanceOverride ¶
func CreateInstanceOverride(ctx context.Context, db dbtx, object migration.InstanceOverride) (_ int64, _err error)
CreateInstanceOverride adds a new instance_override to the database. generator: instance_override Create
func CreateNetwork ¶
CreateNetwork adds a new network to the database. generator: network Create
func CreateSource ¶
CreateSource adds a new source to the database. generator: source Create
func CreateTarget ¶
CreateTarget adds a new target to the database. generator: target Create
func DeleteBatch ¶
DeleteBatch deletes the batch matching the given key parameters. generator: batch DeleteOne-by-Name
func DeleteInstance ¶
DeleteInstance deletes the instance matching the given key parameters. generator: instance DeleteOne-by-UUID
func DeleteInstanceOverride ¶
DeleteInstanceOverride deletes the instance_override matching the given key parameters. generator: instance_override DeleteOne-by-UUID
func DeleteNetwork ¶
DeleteNetwork deletes the network matching the given key parameters. generator: network DeleteOne-by-Name
func DeleteSource ¶
DeleteSource deletes the source matching the given key parameters. generator: source DeleteOne-by-Name
func DeleteTarget ¶
DeleteTarget deletes the target matching the given key parameters. generator: target DeleteOne-by-Name
func GetBatchID ¶
GetBatchID return the ID of the batch with the given key. generator: batch ID
func GetBatchNames ¶
func GetBatchNames(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []string, _err error)
GetBatchNames returns the identifying field of batch. generator: batch GetNames
func GetBatches ¶
func GetBatches(ctx context.Context, db dbtx, filters ...BatchFilter) (_ []migration.Batch, _err error)
GetBatches returns all available batches. generator: batch GetMany
func GetInstance ¶
GetInstance returns the instance with the given key. generator: instance GetOne
func GetInstanceID ¶
GetInstanceID return the ID of the instance with the given key. generator: instance ID
func GetInstanceNames ¶
func GetInstanceNames(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []uuid.UUID, _err error)
GetInstanceNames returns the identifying field of instance. generator: instance GetNames
func GetInstanceOverride ¶
func GetInstanceOverride(ctx context.Context, db dbtx, uuid uuid.UUID) (_ *migration.InstanceOverride, _err error)
GetInstanceOverride returns the instance_override with the given key. generator: instance_override GetOne
func GetInstanceOverrideID ¶
GetInstanceOverrideID return the ID of the instance_override with the given key. generator: instance_override ID
func GetInstanceOverrides ¶
func GetInstanceOverrides(ctx context.Context, db dbtx, filters ...InstanceOverrideFilter) (_ []migration.InstanceOverride, _err error)
GetInstanceOverrides returns all available instance_overrides. generator: instance_override GetMany
func GetInstances ¶
func GetInstances(ctx context.Context, db dbtx, filters ...InstanceFilter) (_ []migration.Instance, _err error)
GetInstances returns all available instances. generator: instance GetMany
func GetNetwork ¶
GetNetwork returns the network with the given key. generator: network GetOne
func GetNetworkID ¶
GetNetworkID return the ID of the network with the given key. generator: network ID
func GetNetworkNames ¶
func GetNetworkNames(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []string, _err error)
GetNetworkNames returns the identifying field of network. generator: network GetNames
func GetNetworks ¶
func GetNetworks(ctx context.Context, db dbtx, filters ...NetworkFilter) (_ []migration.Network, _err error)
GetNetworks returns all available networks. generator: network GetMany
func GetSourceID ¶
GetSourceID return the ID of the source with the given key. generator: source ID
func GetSourceNames ¶
func GetSourceNames(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []string, _err error)
GetSourceNames returns the identifying field of source. generator: source GetNames
func GetSources ¶
func GetSources(ctx context.Context, db dbtx, filters ...SourceFilter) (_ []migration.Source, _err error)
GetSources returns all available sources. generator: source GetMany
func GetTargetID ¶
GetTargetID return the ID of the target with the given key. generator: target ID
func GetTargetNames ¶
func GetTargetNames(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []string, _err error)
GetTargetNames returns the identifying field of target. generator: target GetNames
func GetTargets ¶
func GetTargets(ctx context.Context, db dbtx, filters ...TargetFilter) (_ []migration.Target, _err error)
GetTargets returns all available targets. generator: target GetMany
func NetworkExists ¶
NetworkExists checks if a network with the given key exists. generator: network Exists
func PrepareStmts ¶
PrepareStmts prepares all registered statements and returns an index from statement code to prepared statement object.
func RegisterStmt ¶
RegisterStmt register a SQL statement.
Registered statements will be prepared upfront and reused, to speed up execution.
Return a unique registration code.
func RenameBatch ¶
RenameBatch renames the batch matching the given key parameters. generator: batch Rename
func RenameNetwork ¶
RenameNetwork renames the network matching the given key parameters. generator: network Rename
func RenameSource ¶
RenameSource renames the source matching the given key parameters. generator: source Rename
func RenameTarget ¶
RenameTarget renames the target matching the given key parameters. generator: target Rename
func SourceExists ¶
SourceExists checks if a source with the given key exists. generator: source Exists
func StmtString ¶
StmtString returns the in-memory query string with the given code.
func TargetExists ¶
TargetExists checks if a target with the given key exists. generator: target Exists
func UpdateBatch ¶
UpdateBatch updates the batch matching the given key parameters. generator: batch Update
func UpdateInstance ¶
func UpdateInstance(ctx context.Context, db tx, uuid uuid.UUID, object migration.Instance) (_err error)
UpdateInstance updates the instance matching the given key parameters. generator: instance Update
func UpdateInstanceOverride ¶
func UpdateInstanceOverride(ctx context.Context, db tx, uuid uuid.UUID, object migration.InstanceOverride) (_err error)
UpdateInstanceOverride updates the instance_override matching the given key parameters. generator: instance_override Update
func UpdateNetwork ¶
UpdateNetwork updates the network matching the given key parameters. generator: network Update
func UpdateSource ¶
UpdateSource updates the source matching the given key parameters. generator: source Update
Types ¶
type BatchFilter ¶
type BatchFilter struct { Name *string Status *api.BatchStatusType }
type InstanceFilter ¶
type InstanceOverrideFilter ¶
type Marshaler ¶
Marshaler is the interface that wraps the MarshalDB method, which converts the underlying type into a string representation suitable for persistence in the database.
type NetworkFilter ¶
type NetworkFilter struct {
Name *string
}
type SourceFilter ¶
type SourceFilter struct {
Name *string
}
type TargetFilter ¶
type TargetFilter struct {
Name *string
}
type Unmarshaler ¶
Unmarshaler is the interface that wraps the UnmarshalDB method, which converts a string representation retrieved from the database into the underlying type.