mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
Full module path rebrand from Temporal to Hanzo Tasks: - go.mod module: github.com/hanzoai/tasks - All internal Go imports updated (1906 files) - cmd/server renamed to cmd/tasksd - Binary name: tasksd (was temporal-server) - Docker images: hanzoai/tasks (was temporalio/server) - README rewritten with Hanzo Tasks branding - LLM.md created with integration notes - Makefile, goreleaser, CI workflows updated - go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos) Fork of Temporal.io (MIT license).
60 lines
1.2 KiB
Go
60 lines
1.2 KiB
Go
//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination visibility_query_converter_mock.go
|
|
|
|
package sqlplugin
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
|
|
"github.com/temporalio/sqlparser"
|
|
"github.com/hanzoai/tasks/common/persistence/visibility/store/query"
|
|
)
|
|
|
|
type (
|
|
VisibilityPageToken struct {
|
|
CloseTime time.Time
|
|
StartTime time.Time
|
|
RunID string
|
|
}
|
|
)
|
|
|
|
func DeserializeVisibilityPageToken(data []byte) (*VisibilityPageToken, error) {
|
|
if len(data) == 0 {
|
|
return nil, nil
|
|
}
|
|
var token *VisibilityPageToken
|
|
err := json.Unmarshal(data, &token)
|
|
return token, err
|
|
}
|
|
|
|
func SerializeVisibilityPageToken(token *VisibilityPageToken) ([]byte, error) {
|
|
data, err := json.Marshal(token)
|
|
return data, err
|
|
}
|
|
|
|
type VisibilityQueryConverter interface {
|
|
GetDatetimeFormat() string
|
|
|
|
ConvertKeywordListComparisonExpr(
|
|
operator string,
|
|
col *query.SAColumn,
|
|
value sqlparser.Expr,
|
|
) (sqlparser.Expr, error)
|
|
|
|
ConvertTextComparisonExpr(
|
|
operator string,
|
|
col *query.SAColumn,
|
|
value sqlparser.Expr,
|
|
) (sqlparser.Expr, error)
|
|
|
|
BuildSelectStmt(
|
|
queryExpr *query.QueryParams[sqlparser.Expr],
|
|
pageSize int,
|
|
pageToken *VisibilityPageToken,
|
|
) (string, []any)
|
|
|
|
BuildCountStmt(
|
|
queryExpr *query.QueryParams[sqlparser.Expr],
|
|
) (string, []any)
|
|
}
|