Files
tasks/common/persistence/sql/sqlplugin/history_execution.go
T
Alex ShtinandGitHub 8e8f1b0f7c Remove license header from every file (#7689)
## What changed?
<!-- Describe what has changed in this PR -->
Remove license header from every file. Because it is really hard to
follow in this PR here is the summary:
1. License header is removed from all `.go` and `.proto` files
:fireworks::fireworks:🎆.
2. `LICENSE` file in the root directory has only Temporal and Uber
copyrights.
3. 5 other `LICENSE` files added to the packages which have copyrights
different from Temporal and Uber: Datadog, Xargin, "Mat Ryer, Tyler
Bunnell and contributors".
4. `license_file` flag is removed from all code generation tools.
5. `copyright_file` flag is removed from `go:generate mockgen`
directive.
6. All copyright related targets are removed from `Makefile`.
7. Updated Temporal copyright year to 2025 everywhere.

## Why?
<!-- Tell your future self why have you made these changes -->
I double checked with legal department that it is not needed to have
license header in every file. One file per repo is enough. I put all
copyrights to the root `LICENSE` file and removed header from all other
files. Also updated tools and `Makefile`.
2025-05-01 18:50:21 -07:00

93 lines
3.5 KiB
Go

package sqlplugin
import (
"context"
"database/sql"
"time"
enumspb "go.temporal.io/api/enums/v1"
enumsspb "go.temporal.io/server/api/enums/v1"
"go.temporal.io/server/common/primitives"
)
type (
// ExecutionsRow represents a row in executions table
ExecutionsRow struct {
ShardID int32
NamespaceID primitives.UUID
WorkflowID string
RunID primitives.UUID
NextEventID int64
LastWriteVersion int64
Data []byte
DataEncoding string
State []byte
StateEncoding string
DBRecordVersion int64
}
// ExecutionsFilter contains the column names within executions table that
// can be used to filter results through a WHERE clause
ExecutionsFilter struct {
ShardID int32
NamespaceID primitives.UUID
WorkflowID string
RunID primitives.UUID
}
// CurrentExecutionsRow represents a row in current_executions table
CurrentExecutionsRow struct {
ShardID int32
NamespaceID primitives.UUID
WorkflowID string
RunID primitives.UUID
CreateRequestID string
StartTime *time.Time
LastWriteVersion int64
State enumsspb.WorkflowExecutionState
Status enumspb.WorkflowExecutionStatus
Data []byte
DataEncoding string
}
// CurrentExecutionsFilter contains the column names within current_executions table that
// can be used to filter results through a WHERE clause
CurrentExecutionsFilter struct {
ShardID int32
NamespaceID primitives.UUID
WorkflowID string
RunID primitives.UUID
}
// TODO remove this block in 1.12.x
ExecutionVersion struct {
DBRecordVersion int64
NextEventID int64
}
// HistoryExecution is the SQL persistence interface for history executions
HistoryExecution interface {
InsertIntoExecutions(ctx context.Context, row *ExecutionsRow) (sql.Result, error)
UpdateExecutions(ctx context.Context, row *ExecutionsRow) (sql.Result, error)
SelectFromExecutions(ctx context.Context, filter ExecutionsFilter) (*ExecutionsRow, error)
DeleteFromExecutions(ctx context.Context, filter ExecutionsFilter) (sql.Result, error)
ReadLockExecutions(ctx context.Context, filter ExecutionsFilter) (int64, int64, error)
WriteLockExecutions(ctx context.Context, filter ExecutionsFilter) (int64, int64, error)
LockCurrentExecutionsJoinExecutions(ctx context.Context, filter CurrentExecutionsFilter) ([]CurrentExecutionsRow, error)
InsertIntoCurrentExecutions(ctx context.Context, row *CurrentExecutionsRow) (sql.Result, error)
UpdateCurrentExecutions(ctx context.Context, row *CurrentExecutionsRow) (sql.Result, error)
// SelectFromCurrentExecutions returns one or more rows from current_executions table
// Required params - {shardID, namespaceID, workflowID}
SelectFromCurrentExecutions(ctx context.Context, filter CurrentExecutionsFilter) (*CurrentExecutionsRow, error)
// DeleteFromCurrentExecutions deletes a single row that matches the filter criteria
// If a row exist, that row will be deleted and this method will return success
// If there is no row matching the filter criteria, this method will still return success
// Callers can check the output of Result.RowsAffected() to see if a row was deleted or not
// Required params - {shardID, namespaceID, workflowID, runID}
DeleteFromCurrentExecutions(ctx context.Context, filter CurrentExecutionsFilter) (sql.Result, error)
LockCurrentExecutions(ctx context.Context, filter CurrentExecutionsFilter) (*CurrentExecutionsRow, error)
}
)