Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Registry = []interface{}{&IdempotencyKey{}}
)
Functions ¶
func Register ¶
func Register(models ...interface{})
Register adds models to the global migration registry.
func RegisterDialect ¶ added in v0.2.0
func RegisterDialect(name string, provider DialectProvider)
Types ¶
type DB ¶
DB represents the database connection wrapper.
func (*DB) AutoMigrateAll ¶
AutoMigrate runs the GORM AutoMigrate for all registered models.
func (*DB) IsProcessed ¶
IsProcessed checks if an operation has already been completed.
func (*DB) MarkProcessed ¶
MarkProcessed records that an operation has been completed.
type DialectProvider ¶ added in v0.2.0
type DialectProvider = mdk.DialectProvider
func GetDialect ¶ added in v0.2.0
func GetDialect(name string) (DialectProvider, bool)
type IdempotencyKey ¶
type IdempotencyKey struct {
ID string `gorm:"primaryKey"`
Scope string `gorm:"index:idx_scope_key,unique"` // e.g. "workflow_step"
Key string `gorm:"index:idx_scope_key,unique"` // e.g. "wfID_stepID"
CreatedAt time.Time
}
IdempotencyKey prevents duplicate processing of the same operation.
Click to show internal directories.
Click to hide internal directories.