mysql

package
v1.2.17-prerelease03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2025 License: MIT Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PluginName is the name of the plugin
	PluginName = "mysql"
)

Variables

This section is empty.

Functions

func GetTestClusterOption

func GetTestClusterOption() (*pt.TestBaseOptions, error)

GetTestClusterOption return test options

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(xdbs []*sqlx.DB, tx *sqlx.Tx, dbShardID int, numDBShards int, converter DataConverter) (*DB, error)

NewDB returns an instance of DB, which is a logical connection to the underlying mysql database dbShardID is needed when tx is not nil

func (*DB) BeginTx

func (mdb *DB) BeginTx(ctx context.Context, dbShardID int) (sqlplugin.Tx, error)

BeginTx starts a new transaction and returns a reference to the Tx object

func (*DB) Close

func (mdb *DB) Close() error

Close closes the connection to the mysql db

func (*DB) Commit

func (mdb *DB) Commit() error

Commit commits a previously started transaction

func (*DB) CreateDatabase

func (mdb *DB) CreateDatabase(name string) error

CreateDatabase creates a database if it doesn't exist

func (*DB) CreateSchemaVersionTables

func (mdb *DB) CreateSchemaVersionTables() error

CreateSchemaVersionTables sets up the schema version tables

func (*DB) DeleteFromActivityInfoMaps

func (mdb *DB) DeleteFromActivityInfoMaps(ctx context.Context, filter *sqlplugin.ActivityInfoMapsFilter) (sql.Result, error)

DeleteFromActivityInfoMaps deletes one or more rows from activity_info_maps table

func (*DB) DeleteFromBufferedEvents

func (mdb *DB) DeleteFromBufferedEvents(ctx context.Context, filter *sqlplugin.BufferedEventsFilter) (sql.Result, error)

DeleteFromBufferedEvents deletes one or more rows from buffered_events table

func (*DB) DeleteFromChildExecutionInfoMaps

func (mdb *DB) DeleteFromChildExecutionInfoMaps(ctx context.Context, filter *sqlplugin.ChildExecutionInfoMapsFilter) (sql.Result, error)

DeleteFromChildExecutionInfoMaps deletes one or more rows from child_execution_info_maps table

func (*DB) DeleteFromCrossClusterTasks

func (mdb *DB) DeleteFromCrossClusterTasks(ctx context.Context, filter *sqlplugin.CrossClusterTasksFilter) (sql.Result, error)

DeleteFromCrossClusterTasks deletes one row from cross_cluster_tasks table

func (*DB) DeleteFromCurrentExecutions

func (mdb *DB) DeleteFromCurrentExecutions(ctx context.Context, filter *sqlplugin.CurrentExecutionsFilter) (sql.Result, error)

DeleteFromCurrentExecutions deletes a single row in current_executions table

func (*DB) DeleteFromDomain

func (mdb *DB) DeleteFromDomain(ctx context.Context, filter *sqlplugin.DomainFilter) (sql.Result, error)

DeleteFromDomain deletes a single row in domains table

func (*DB) DeleteFromExecutions

func (mdb *DB) DeleteFromExecutions(ctx context.Context, filter *sqlplugin.ExecutionsFilter) (sql.Result, error)

DeleteFromExecutions deletes a single row from executions table

func (*DB) DeleteFromHistoryNode

func (mdb *DB) DeleteFromHistoryNode(ctx context.Context, filter *sqlplugin.HistoryNodeFilter) (sql.Result, error)

DeleteFromHistoryNode deletes one or more rows from history_node table

func (*DB) DeleteFromHistoryTree

func (mdb *DB) DeleteFromHistoryTree(ctx context.Context, filter *sqlplugin.HistoryTreeFilter) (sql.Result, error)

DeleteFromHistoryTree deletes one or more rows from history_tree table

func (*DB) DeleteFromReplicationTasks

func (mdb *DB) DeleteFromReplicationTasks(ctx context.Context, filter *sqlplugin.ReplicationTasksFilter) (sql.Result, error)

DeleteFromReplicationTasks deletes one row from replication_tasks table

func (*DB) DeleteFromRequestCancelInfoMaps

func (mdb *DB) DeleteFromRequestCancelInfoMaps(ctx context.Context, filter *sqlplugin.RequestCancelInfoMapsFilter) (sql.Result, error)

DeleteFromRequestCancelInfoMaps deletes one or more rows from request_cancel_info_maps table

func (*DB) DeleteFromSignalInfoMaps

func (mdb *DB) DeleteFromSignalInfoMaps(ctx context.Context, filter *sqlplugin.SignalInfoMapsFilter) (sql.Result, error)

DeleteFromSignalInfoMaps deletes one or more rows from signal_info_maps table

func (*DB) DeleteFromSignalsRequestedSets

func (mdb *DB) DeleteFromSignalsRequestedSets(ctx context.Context, filter *sqlplugin.SignalsRequestedSetsFilter) (sql.Result, error)

DeleteFromSignalsRequestedSets deletes one or more rows from signals_requested_sets table

func (*DB) DeleteFromTaskLists

func (mdb *DB) DeleteFromTaskLists(ctx context.Context, filter *sqlplugin.TaskListsFilter) (sql.Result, error)

DeleteFromTaskLists deletes a row from task_lists table

func (*DB) DeleteFromTasks

func (mdb *DB) DeleteFromTasks(ctx context.Context, filter *sqlplugin.TasksFilter) (sql.Result, error)

DeleteFromTasks deletes one or more rows from tasks table

func (*DB) DeleteFromTimerInfoMaps

func (mdb *DB) DeleteFromTimerInfoMaps(ctx context.Context, filter *sqlplugin.TimerInfoMapsFilter) (sql.Result, error)

DeleteFromTimerInfoMaps deletes one or more rows from timer_info_maps table

func (*DB) DeleteFromTimerTasks

func (mdb *DB) DeleteFromTimerTasks(ctx context.Context, filter *sqlplugin.TimerTasksFilter) (sql.Result, error)

DeleteFromTimerTasks deletes one row from timer_tasks table

func (*DB) DeleteFromTransferTasks

func (mdb *DB) DeleteFromTransferTasks(ctx context.Context, filter *sqlplugin.TransferTasksFilter) (sql.Result, error)

DeleteFromTransferTasks deletes one row from transfer_tasks table

func (*DB) DeleteFromVisibility

func (mdb *DB) DeleteFromVisibility(ctx context.Context, filter *sqlplugin.VisibilityFilter) (sql.Result, error)

DeleteFromVisibility deletes a row from visibility table if it exist

func (*DB) DeleteMessage

func (mdb *DB) DeleteMessage(
	ctx context.Context,
	queueType persistence.QueueType,
	messageID int64,
) (sql.Result, error)

DeleteMessage deletes message with a messageID from the queue

func (*DB) DeleteMessageFromReplicationTasksDLQ

func (mdb *DB) DeleteMessageFromReplicationTasksDLQ(
	ctx context.Context,
	filter *sqlplugin.ReplicationTasksDLQFilter,
) (sql.Result, error)

DeleteMessageFromReplicationTasksDLQ deletes one row from replication_tasks_dlq table

func (*DB) DeleteMessagesBefore

func (mdb *DB) DeleteMessagesBefore(
	ctx context.Context,
	queueType persistence.QueueType,
	messageID int64,
) (sql.Result, error)

DeleteMessagesBefore deletes messages before messageID from the queue

func (*DB) DropAllTables

func (mdb *DB) DropAllTables(database string) error

DropAllTables drops all tables from this database

func (*DB) DropDatabase

func (mdb *DB) DropDatabase(name string) error

DropDatabase drops a database

func (*DB) DropTable

func (mdb *DB) DropTable(name string) error

DropTable drops a given table from the database

func (*DB) ExecSchemaOperationQuery

func (mdb *DB) ExecSchemaOperationQuery(ctx context.Context, stmt string, args ...interface{}) error

ExecSchemaOperationQuery executes a sql statement for schema ONLY. DO NOT use it in other cases, otherwise it will not work for multiple SQL database. For Sharded SQL, it will execute the statement for all shards

func (*DB) GetAckLevels

func (mdb *DB) GetAckLevels(
	ctx context.Context,
	queueType persistence.QueueType,
	forUpdate bool,
) (map[string]int64, error)

GetAckLevels returns ack levels for pulling clusters

func (*DB) GetAllHistoryTreeBranches

func (mdb *DB) GetAllHistoryTreeBranches(ctx context.Context, filter *sqlplugin.HistoryTreeFilter) ([]sqlplugin.HistoryTreeRow, error)

func (*DB) GetLastEnqueuedMessageIDForUpdate

func (mdb *DB) GetLastEnqueuedMessageIDForUpdate(
	ctx context.Context,
	queueType persistence.QueueType,
) (int64, error)

GetLastEnqueuedMessageIDForUpdate returns the last enqueued message ID

func (*DB) GetMessagesBetween

func (mdb *DB) GetMessagesBetween(
	ctx context.Context,
	queueType persistence.QueueType,
	firstMessageID int64,
	lastMessageID int64,
	maxRows int,
) ([]sqlplugin.QueueRow, error)

GetMessagesBetween retrieves messages from the queue

func (*DB) GetMessagesFromQueue

func (mdb *DB) GetMessagesFromQueue(
	ctx context.Context,
	queueType persistence.QueueType,
	lastMessageID int64,
	maxRows int,
) ([]sqlplugin.QueueRow, error)

GetMessagesFromQueue retrieves messages from the queue

func (*DB) GetOrphanTasks

func (mdb *DB) GetOrphanTasks(ctx context.Context, filter *sqlplugin.OrphanTasksFilter) ([]sqlplugin.TaskKeyRow, error)

func (*DB) GetQueueSize

func (mdb *DB) GetQueueSize(
	ctx context.Context,
	queueType persistence.QueueType,
) (int64, error)

GetQueueSize returns the queue size

func (*DB) GetTasksCount

func (mdb *DB) GetTasksCount(ctx context.Context, filter *sqlplugin.TasksFilter) (int64, error)

func (*DB) GetTotalNumDBShards

func (mdb *DB) GetTotalNumDBShards() int

func (*DB) InsertAckLevel

func (mdb *DB) InsertAckLevel(
	ctx context.Context,
	queueType persistence.QueueType,
	messageID int64,
	clusterName string,
) error

InsertAckLevel inserts ack level

func (*DB) InsertConfig

func (mdb *DB) InsertConfig(ctx context.Context, row *persistence.InternalConfigStoreEntry) error

func (*DB) InsertIntoBufferedEvents

func (mdb *DB) InsertIntoBufferedEvents(ctx context.Context, rows []sqlplugin.BufferedEventsRow) (sql.Result, error)

InsertIntoBufferedEvents inserts one or more rows into buffered_events table

func (*DB) InsertIntoCrossClusterTasks

func (mdb *DB) InsertIntoCrossClusterTasks(ctx context.Context, rows []sqlplugin.CrossClusterTasksRow) (sql.Result, error)

InsertIntoCrossClusterTasks inserts one or more rows into cross_cluster_tasks table

func (*DB) InsertIntoCurrentExecutions

func (mdb *DB) InsertIntoCurrentExecutions(ctx context.Context, row *sqlplugin.CurrentExecutionsRow) (sql.Result, error)

InsertIntoCurrentExecutions inserts a single row into current_executions table

func (*DB) InsertIntoDomain

func (mdb *DB) InsertIntoDomain(ctx context.Context, row *sqlplugin.DomainRow) (sql.Result, error)

InsertIntoDomain inserts a single row into domains table

func (*DB) InsertIntoExecutions

func (mdb *DB) InsertIntoExecutions(ctx context.Context, row *sqlplugin.ExecutionsRow) (sql.Result, error)

InsertIntoExecutions inserts a row into executions table

func (*DB) InsertIntoHistoryNode

func (mdb *DB) InsertIntoHistoryNode(ctx context.Context, row *sqlplugin.HistoryNodeRow) (sql.Result, error)

InsertIntoHistoryNode inserts a row into history_node table

func (*DB) InsertIntoHistoryTree

func (mdb *DB) InsertIntoHistoryTree(ctx context.Context, row *sqlplugin.HistoryTreeRow) (sql.Result, error)

InsertIntoHistoryTree inserts a row into history_tree table

func (*DB) InsertIntoQueue

func (mdb *DB) InsertIntoQueue(
	ctx context.Context,
	row *sqlplugin.QueueRow,
) (sql.Result, error)

InsertIntoQueue inserts a new row into queue table

func (*DB) InsertIntoReplicationTasks

func (mdb *DB) InsertIntoReplicationTasks(ctx context.Context, rows []sqlplugin.ReplicationTasksRow) (sql.Result, error)

InsertIntoReplicationTasks inserts one or more rows into replication_tasks table

func (*DB) InsertIntoReplicationTasksDLQ

func (mdb *DB) InsertIntoReplicationTasksDLQ(ctx context.Context, row *sqlplugin.ReplicationTaskDLQRow) (sql.Result, error)

InsertIntoReplicationTasksDLQ inserts one or more rows into replication_tasks_dlq table

func (*DB) InsertIntoShards

func (mdb *DB) InsertIntoShards(ctx context.Context, row *sqlplugin.ShardsRow) (sql.Result, error)

InsertIntoShards inserts one or more rows into shards table

func (*DB) InsertIntoSignalsRequestedSets

func (mdb *DB) InsertIntoSignalsRequestedSets(ctx context.Context, rows []sqlplugin.SignalsRequestedSetsRow) (sql.Result, error)

InsertIntoSignalsRequestedSets inserts one or more rows into signals_requested_sets table

func (*DB) InsertIntoTaskLists

func (mdb *DB) InsertIntoTaskLists(ctx context.Context, row *sqlplugin.TaskListsRow) (sql.Result, error)

InsertIntoTaskLists inserts one or more rows into task_lists table

func (*DB) InsertIntoTaskListsWithTTL

func (mdb *DB) InsertIntoTaskListsWithTTL(_ context.Context, _ *sqlplugin.TaskListsRowWithTTL) (sql.Result, error)

InsertIntoTaskListsWithTTL is not supported in MySQL

func (*DB) InsertIntoTasks

func (mdb *DB) InsertIntoTasks(ctx context.Context, rows []sqlplugin.TasksRow) (sql.Result, error)

InsertIntoTasks inserts one or more rows into tasks table

func (*DB) InsertIntoTasksWithTTL

func (mdb *DB) InsertIntoTasksWithTTL(_ context.Context, _ []sqlplugin.TasksRowWithTTL) (sql.Result, error)

InsertIntoTasksWithTTL is not supported in MySQL

func (*DB) InsertIntoTimerTasks

func (mdb *DB) InsertIntoTimerTasks(ctx context.Context, rows []sqlplugin.TimerTasksRow) (sql.Result, error)

InsertIntoTimerTasks inserts one or more rows into timer_tasks table

func (*DB) InsertIntoTransferTasks

func (mdb *DB) InsertIntoTransferTasks(ctx context.Context, rows []sqlplugin.TransferTasksRow) (sql.Result, error)

InsertIntoTransferTasks inserts one or more rows into transfer_tasks table

func (*DB) InsertIntoVisibility

func (mdb *DB) InsertIntoVisibility(ctx context.Context, row *sqlplugin.VisibilityRow) (sql.Result, error)

InsertIntoVisibility inserts a row into visibility table. If an row already exist, its left as such and no update will be made

func (*DB) IsDupEntryError

func (mdb *DB) IsDupEntryError(err error) bool

func (*DB) IsNotFoundError

func (mdb *DB) IsNotFoundError(err error) bool

func (*DB) IsThrottlingError

func (mdb *DB) IsThrottlingError(err error) bool

func (*DB) IsTimeoutError

func (mdb *DB) IsTimeoutError(err error) bool

func (*DB) ListTables

func (mdb *DB) ListTables(database string) ([]string, error)

ListTables returns a list of tables in this database

func (*DB) LockCurrentExecutions

func (mdb *DB) LockCurrentExecutions(ctx context.Context, filter *sqlplugin.CurrentExecutionsFilter) (*sqlplugin.CurrentExecutionsRow, error)

LockCurrentExecutions acquires a write lock on a single row in current_executions table

func (*DB) LockCurrentExecutionsJoinExecutions

func (mdb *DB) LockCurrentExecutionsJoinExecutions(ctx context.Context, filter *sqlplugin.CurrentExecutionsFilter) ([]sqlplugin.CurrentExecutionsRow, error)

LockCurrentExecutionsJoinExecutions joins a row in current_executions with executions table and acquires a write lock on the result

func (*DB) LockDomainMetadata

func (mdb *DB) LockDomainMetadata(ctx context.Context) error

LockDomainMetadata acquires a write lock on a single row in domain_metadata table

func (*DB) LockTaskLists

func (mdb *DB) LockTaskLists(ctx context.Context, filter *sqlplugin.TaskListsFilter) (int64, error)

LockTaskLists locks a row in task_lists table

func (*DB) MaxAllowedTTL

func (mdb *DB) MaxAllowedTTL() (*time.Duration, error)

MaxAllowedTTL returns the max allowed ttl MySQL supports

func (*DB) PluginName

func (mdb *DB) PluginName() string

PluginName returns the name of the mysql plugin

func (*DB) RangeDeleteFromCrossClusterTasks

func (mdb *DB) RangeDeleteFromCrossClusterTasks(ctx context.Context, filter *sqlplugin.CrossClusterTasksFilter) (sql.Result, error)

RangeDeleteFromCrossClusterTasks deletes multi rows from cross_cluster_tasks table

func (*DB) RangeDeleteFromReplicationTasks

func (mdb *DB) RangeDeleteFromReplicationTasks(ctx context.Context, filter *sqlplugin.ReplicationTasksFilter) (sql.Result, error)

RangeDeleteFromReplicationTasks deletes multi rows from replication_tasks table

func (*DB) RangeDeleteFromTimerTasks

func (mdb *DB) RangeDeleteFromTimerTasks(ctx context.Context, filter *sqlplugin.TimerTasksFilter) (sql.Result, error)

RangeDeleteFromTimerTasks deletes multi rows from timer_tasks table

func (*DB) RangeDeleteFromTransferTasks

func (mdb *DB) RangeDeleteFromTransferTasks(ctx context.Context, filter *sqlplugin.TransferTasksFilter) (sql.Result, error)

RangeDeleteFromTransferTasks deletes multi rows from transfer_tasks table

func (*DB) RangeDeleteMessageFromReplicationTasksDLQ

func (mdb *DB) RangeDeleteMessageFromReplicationTasksDLQ(
	ctx context.Context,
	filter *sqlplugin.ReplicationTasksDLQFilter,
) (sql.Result, error)

DeleteMessageFromReplicationTasksDLQ deletes one or more rows from replication_tasks_dlq table

func (*DB) RangeDeleteMessages

func (mdb *DB) RangeDeleteMessages(
	ctx context.Context,
	queueType persistence.QueueType,
	exclusiveBeginMessageID int64,
	inclusiveEndMessageID int64,
) (sql.Result, error)

RangeDeleteMessages deletes messages before messageID from the queue

func (*DB) ReadLockExecutions

func (mdb *DB) ReadLockExecutions(ctx context.Context, filter *sqlplugin.ExecutionsFilter) (int, error)

ReadLockExecutions acquires a write lock on a single row in executions table

func (*DB) ReadLockShards

func (mdb *DB) ReadLockShards(ctx context.Context, filter *sqlplugin.ShardsFilter) (int, error)

ReadLockShards acquires a read lock on a single row in shards table

func (*DB) ReadSchemaVersion

func (mdb *DB) ReadSchemaVersion(database string) (string, error)

ReadSchemaVersion returns the current schema version for the keyspace

func (*DB) ReplaceIntoActivityInfoMaps

func (mdb *DB) ReplaceIntoActivityInfoMaps(ctx context.Context, rows []sqlplugin.ActivityInfoMapsRow) (sql.Result, error)

ReplaceIntoActivityInfoMaps replaces one or more rows in activity_info_maps table

func (*DB) ReplaceIntoChildExecutionInfoMaps

func (mdb *DB) ReplaceIntoChildExecutionInfoMaps(ctx context.Context, rows []sqlplugin.ChildExecutionInfoMapsRow) (sql.Result, error)

ReplaceIntoChildExecutionInfoMaps replaces one or more rows in child_execution_info_maps table

func (*DB) ReplaceIntoRequestCancelInfoMaps

func (mdb *DB) ReplaceIntoRequestCancelInfoMaps(ctx context.Context, rows []sqlplugin.RequestCancelInfoMapsRow) (sql.Result, error)

ReplaceIntoRequestCancelInfoMaps replaces one or more rows in request_cancel_info_maps table

func (*DB) ReplaceIntoSignalInfoMaps

func (mdb *DB) ReplaceIntoSignalInfoMaps(ctx context.Context, rows []sqlplugin.SignalInfoMapsRow) (sql.Result, error)

ReplaceIntoSignalInfoMaps replaces one or more rows in signal_info_maps table

func (*DB) ReplaceIntoTimerInfoMaps

func (mdb *DB) ReplaceIntoTimerInfoMaps(ctx context.Context, rows []sqlplugin.TimerInfoMapsRow) (sql.Result, error)

ReplaceIntoTimerInfoMaps replaces one or more rows in timer_info_maps table

func (*DB) ReplaceIntoVisibility

func (mdb *DB) ReplaceIntoVisibility(ctx context.Context, row *sqlplugin.VisibilityRow) (sql.Result, error)

ReplaceIntoVisibility replaces an existing row if it exist or creates a new row in visibility table

func (*DB) Rollback

func (mdb *DB) Rollback() error

Rollback triggers rollback of a previously started transaction

func (*DB) SelectFromActivityInfoMaps

func (mdb *DB) SelectFromActivityInfoMaps(ctx context.Context, filter *sqlplugin.ActivityInfoMapsFilter) ([]sqlplugin.ActivityInfoMapsRow, error)

SelectFromActivityInfoMaps reads one or more rows from activity_info_maps table

func (*DB) SelectFromBufferedEvents

func (mdb *DB) SelectFromBufferedEvents(ctx context.Context, filter *sqlplugin.BufferedEventsFilter) ([]sqlplugin.BufferedEventsRow, error)

SelectFromBufferedEvents reads one or more rows from buffered_events table

func (*DB) SelectFromChildExecutionInfoMaps

func (mdb *DB) SelectFromChildExecutionInfoMaps(ctx context.Context, filter *sqlplugin.ChildExecutionInfoMapsFilter) ([]sqlplugin.ChildExecutionInfoMapsRow, error)

SelectFromChildExecutionInfoMaps reads one or more rows from child_execution_info_maps table

func (*DB) SelectFromCrossClusterTasks

func (mdb *DB) SelectFromCrossClusterTasks(ctx context.Context, filter *sqlplugin.CrossClusterTasksFilter) ([]sqlplugin.CrossClusterTasksRow, error)

SelectFromCrossClusterTasks reads one or more rows from cross_cluster_tasks table

func (*DB) SelectFromCurrentExecutions

func (mdb *DB) SelectFromCurrentExecutions(ctx context.Context, filter *sqlplugin.CurrentExecutionsFilter) (*sqlplugin.CurrentExecutionsRow, error)

SelectFromCurrentExecutions reads one or more rows from current_executions table

func (*DB) SelectFromDomain

func (mdb *DB) SelectFromDomain(ctx context.Context, filter *sqlplugin.DomainFilter) ([]sqlplugin.DomainRow, error)

SelectFromDomain reads one or more rows from domains table

func (*DB) SelectFromDomainMetadata

func (mdb *DB) SelectFromDomainMetadata(ctx context.Context) (*sqlplugin.DomainMetadataRow, error)

SelectFromDomainMetadata reads a single row in domain_metadata table

func (*DB) SelectFromExecutions

func (mdb *DB) SelectFromExecutions(ctx context.Context, filter *sqlplugin.ExecutionsFilter) ([]sqlplugin.ExecutionsRow, error)

SelectFromExecutions reads a single row from executions table The list execution query result is order by workflow ID only. It may returns duplicate record with pagination.

func (*DB) SelectFromHistoryNode

func (mdb *DB) SelectFromHistoryNode(ctx context.Context, filter *sqlplugin.HistoryNodeFilter) ([]sqlplugin.HistoryNodeRow, error)

SelectFromHistoryNode reads one or more rows from history_node table

func (*DB) SelectFromHistoryTree

func (mdb *DB) SelectFromHistoryTree(ctx context.Context, filter *sqlplugin.HistoryTreeFilter) ([]sqlplugin.HistoryTreeRow, error)

SelectFromHistoryTree reads one or more rows from history_tree table

func (*DB) SelectFromReplicationDLQ

func (mdb *DB) SelectFromReplicationDLQ(ctx context.Context, filter *sqlplugin.ReplicationTaskDLQFilter) (int64, error)

SelectFromReplicationDLQ reads one row from replication_tasks_dlq table

func (*DB) SelectFromReplicationTasks

func (mdb *DB) SelectFromReplicationTasks(ctx context.Context, filter *sqlplugin.ReplicationTasksFilter) ([]sqlplugin.ReplicationTasksRow, error)

SelectFromReplicationTasks reads one or more rows from replication_tasks table

func (*DB) SelectFromReplicationTasksDLQ

func (mdb *DB) SelectFromReplicationTasksDLQ(ctx context.Context, filter *sqlplugin.ReplicationTasksDLQFilter) ([]sqlplugin.ReplicationTasksRow, error)

SelectFromReplicationTasksDLQ reads one or more rows from replication_tasks_dlq table

func (*DB) SelectFromRequestCancelInfoMaps

func (mdb *DB) SelectFromRequestCancelInfoMaps(ctx context.Context, filter *sqlplugin.RequestCancelInfoMapsFilter) ([]sqlplugin.RequestCancelInfoMapsRow, error)

SelectFromRequestCancelInfoMaps reads one or more rows from request_cancel_info_maps table

func (*DB) SelectFromShards

func (mdb *DB) SelectFromShards(ctx context.Context, filter *sqlplugin.ShardsFilter) (*sqlplugin.ShardsRow, error)

SelectFromShards reads one or more rows from shards table

func (*DB) SelectFromSignalInfoMaps

func (mdb *DB) SelectFromSignalInfoMaps(ctx context.Context, filter *sqlplugin.SignalInfoMapsFilter) ([]sqlplugin.SignalInfoMapsRow, error)

SelectFromSignalInfoMaps reads one or more rows from signal_info_maps table

func (*DB) SelectFromSignalsRequestedSets

func (mdb *DB) SelectFromSignalsRequestedSets(ctx context.Context, filter *sqlplugin.SignalsRequestedSetsFilter) ([]sqlplugin.SignalsRequestedSetsRow, error)

SelectFromSignalsRequestedSets reads one or more rows from signals_requested_sets table

func (*DB) SelectFromTaskLists

func (mdb *DB) SelectFromTaskLists(ctx context.Context, filter *sqlplugin.TaskListsFilter) ([]sqlplugin.TaskListsRow, error)

SelectFromTaskLists reads one or more rows from task_lists table

func (*DB) SelectFromTasks

func (mdb *DB) SelectFromTasks(ctx context.Context, filter *sqlplugin.TasksFilter) ([]sqlplugin.TasksRow, error)

SelectFromTasks reads one or more rows from tasks table

func (*DB) SelectFromTimerInfoMaps

func (mdb *DB) SelectFromTimerInfoMaps(ctx context.Context, filter *sqlplugin.TimerInfoMapsFilter) ([]sqlplugin.TimerInfoMapsRow, error)

SelectFromTimerInfoMaps reads one or more rows from timer_info_maps table

func (*DB) SelectFromTimerTasks

func (mdb *DB) SelectFromTimerTasks(ctx context.Context, filter *sqlplugin.TimerTasksFilter) ([]sqlplugin.TimerTasksRow, error)

SelectFromTimerTasks reads one or more rows from timer_tasks table

func (*DB) SelectFromTransferTasks

func (mdb *DB) SelectFromTransferTasks(ctx context.Context, filter *sqlplugin.TransferTasksFilter) ([]sqlplugin.TransferTasksRow, error)

SelectFromTransferTasks reads one or more rows from transfer_tasks table

func (*DB) SelectFromVisibility

func (mdb *DB) SelectFromVisibility(ctx context.Context, filter *sqlplugin.VisibilityFilter) ([]sqlplugin.VisibilityRow, error)

SelectFromVisibility reads one or more rows from visibility table

func (*DB) SelectLatestConfig

func (mdb *DB) SelectLatestConfig(ctx context.Context, rowType int) (*persistence.InternalConfigStoreEntry, error)

func (*DB) SupportsAsyncTransaction

func (mdb *DB) SupportsAsyncTransaction() bool

SupportsTTL returns weather MySQL supports Asynchronous transaction

func (*DB) SupportsTTL

func (mdb *DB) SupportsTTL() bool

SupportsTTL returns weather MySQL supports TTL

func (*DB) UpdateAckLevels

func (mdb *DB) UpdateAckLevels(
	ctx context.Context,
	queueType persistence.QueueType,
	clusterAckLevels map[string]int64,
) error

UpdateAckLevels updates cluster ack levels

func (*DB) UpdateCurrentExecutions

func (mdb *DB) UpdateCurrentExecutions(ctx context.Context, row *sqlplugin.CurrentExecutionsRow) (sql.Result, error)

UpdateCurrentExecutions updates a single row in current_executions table

func (*DB) UpdateDomain

func (mdb *DB) UpdateDomain(ctx context.Context, row *sqlplugin.DomainRow) (sql.Result, error)

UpdateDomain updates a single row in domains table

func (*DB) UpdateDomainMetadata

func (mdb *DB) UpdateDomainMetadata(ctx context.Context, row *sqlplugin.DomainMetadataRow) (sql.Result, error)

UpdateDomainMetadata updates a single row in domain_metadata table

func (*DB) UpdateExecutions

func (mdb *DB) UpdateExecutions(ctx context.Context, row *sqlplugin.ExecutionsRow) (sql.Result, error)

UpdateExecutions updates a single row in executions table

func (*DB) UpdateSchemaVersion

func (mdb *DB) UpdateSchemaVersion(database string, newVersion string, minCompatibleVersion string) error

UpdateSchemaVersion updates the schema version for the keyspace

func (*DB) UpdateShards

func (mdb *DB) UpdateShards(ctx context.Context, row *sqlplugin.ShardsRow) (sql.Result, error)

UpdateShards updates one or more rows into shards table

func (*DB) UpdateTaskLists

func (mdb *DB) UpdateTaskLists(ctx context.Context, row *sqlplugin.TaskListsRow) (sql.Result, error)

UpdateTaskLists updates a row in task_lists table

func (*DB) UpdateTaskListsWithTTL

func (mdb *DB) UpdateTaskListsWithTTL(_ context.Context, _ *sqlplugin.TaskListsRowWithTTL) (sql.Result, error)

UpdateTaskListsWithTTL is not supported in MySQL

func (*DB) WriteLockExecutions

func (mdb *DB) WriteLockExecutions(ctx context.Context, filter *sqlplugin.ExecutionsFilter) (int, error)

WriteLockExecutions acquires a write lock on a single row in executions table

func (*DB) WriteLockShards

func (mdb *DB) WriteLockShards(ctx context.Context, filter *sqlplugin.ShardsFilter) (int, error)

WriteLockShards acquires a write lock on a single row in shards table

func (*DB) WriteSchemaUpdateLog

func (mdb *DB) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error

WriteSchemaUpdateLog adds an entry to the schema update history table

type DataConverter

type DataConverter interface {
	ToDateTime(t time.Time) time.Time
	FromDateTime(t time.Time) time.Time
}

DataConverter defines the API for conversions to/from go types to mysql datatypes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL