Documentation
¶
Overview ¶
Package databasecontrol owns Modary's privileged database assembly boundary. It is internal so consumers can receive database.Access but cannot construct, install, resolve, or operate migration and transaction control.
Index ¶
Constants ¶
const ( SchemaRoleApplication = "application" SchemaRoleQueue = "queue" )
const SchemaProfileTable = "modary_schema_profile"
SchemaProfileTable is the framework-owned physical-schema role marker used by official database components to reject incompatible reuse.
const ServiceName = "modary.database-control"
ServiceName is the reserved internal service name used to install Control through the Module Host's typed service registry. It is internal to this repository; consumers cannot name Control or obtain the matching service key.
Variables ¶
ErrControlUnavailable reports an invalid or unavailable privileged control.
Functions ¶
func ContainsDependencyPanic ¶
ContainsDependencyPanic reports whether err contains the database dependency panic sentinel without dispatching caller-defined error methods.
func SchemaAdvisoryLockKey ¶
SchemaAdvisoryLockKey gives every official component the same lock identity for a physical schema. PostgreSQL scopes advisory locks to one database, so the driver and schema name are sufficient within a connection.
Types ¶
type Backend ¶
type Backend interface {
Driver() string
ValidateMigration(string) error
ReadExecutor(context.Context) (database.Executor, error)
WriteExecutor(context.Context) (database.Executor, error)
AdminExecutor(context.Context) (database.Executor, error)
WithinTransaction(context.Context, func(context.Context) error) error
}
Backend is the complete privileged contract implemented by an official durable adapter. ReadExecutor and WriteExecutor supply the framework-owned consumer facade; the remaining methods own migration, administration, and transaction control. WithinTransaction follows the synchronous exactly-once private Runtime transaction contract and returns an exact framework outcome correlated with the callback error after rollback, or with the completion failure after commit or rollback fails. A nested failure may instead return rollback-pending proof after marking the outer transaction rollback-only. The callback is never retained, retried, overlapped, or called after return. A callback panic is rolled back and propagated without exposing its value.
type Control ¶
type Control interface {
Driver() string
Access() database.Access
Store() database.Store
Executor(context.Context) (database.Executor, error)
WithinTransaction(context.Context, func(context.Context) error) error
ApplyMigrations(context.Context, string, fs.FS) error
// contains filtered or unexported methods
}
Control is the internal capability used by Host assembly and official durable adapters. It is deliberately absent from package database.