session

package
v0.0.0-...-0859444 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: PostgreSQL Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VirtualParamLevelLocal     = "local"
	VirtualParamLevelStatement = "statement"
	VirtualParamLevelTxBlock   = "txBlock"
)
View Source
const (
	SPQR_DISTRIBUTION            = "__spqr__distribution"
	SPQR_DISTRIBUTED_RELATION    = "__spqr__distributed_relation"
	SPQR_DEFAULT_ROUTE_BEHAVIOUR = "__spqr__default_route_behaviour"
	SPQR_AUTO_DISTRIBUTION       = "__spqr__auto_distribution"
	SPQR_DISTRIBUTION_KEY        = "__spqr__distribution_key"
	SPQR_SHARDING_KEY            = "__spqr__sharding_key"
	SPQR_SCATTER_QUERY           = "__spqr__scatter_query"
	SPQR_REPLY_NOTICE            = "__spqr__reply_notice"
	SPQR_MAINTAIN_PARAMS         = "__spqr__maintain_params"
	SPQR_EXECUTE_ON              = "__spqr__execute_on"
	SPQR_ENGINE_V2               = "__spqr__engine_v2"
	SPQR_PREFERRED_ENGINE        = "__spqr__preferred_engine"
	SPQR_COMMIT_STRATEGY         = "__spqr__commit_strategy"
	SPQR_TARGET_SESSION_ATTRS    = "__spqr__target_session_attrs"

	/*XXX: should we ever disallow?*/
	SPQR_ALLOW_SPLIT_UPDATE = "__spqr__allow_split_update"

	/* backward compatibility */
	SPQR_TARGET_SESSION_ATTRS_ALIAS   = "target_session_attrs"
	SPQR_TARGET_SESSION_ATTRS_ALIAS_2 = "target-session-attrs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionParamsHolder

type SessionParamsHolder interface {
	GetTsa() tsa.TSA
	SetTsa(level string, value string)

	ResetTsa()

	Usr() string
	SetUsr(string)

	// Get current session DRB
	DefaultRouteBehaviour() string
	SetDefaultRouteBehaviour(level string, val string)

	/* Only statement-level */
	SetAutoDistribution(val string)
	AutoDistribution() string

	/* Only statement-level */
	SetDistributionKey(val string)
	DistributionKey() string

	SetDistribution(level string, val string)
	Distribution() string

	/*  Only statement level */
	SetDistributedRelation(level string, val string)
	DistributedRelation() string

	SetShardingKey(level string, val string)
	ShardingKey() string

	SetExecuteOn(level string, val string)
	ExecuteOn() string

	SetShowNoticeMsg(level string, val bool)
	ShowNoticeMsg() bool

	/* Statement level makes sence? */
	SetMaintainParams(level string, val bool)
	MaintainParams() bool

	/* route hint always statement-level  */
	SetScatterQuery(val bool)
	ScatterQuery() bool

	/* Check if we apply engine v2 routing for query */
	SetEnhancedMultiShardProcessing(level string, val bool)
	EnhancedMultiShardProcessing() bool

	/*  XXX: developer option */
	SetPreferredEngine(level string, val string)
	PreferredEngine() string

	/*  XXX: developer option */
	SetAllowSplitUpdate(level string, val bool)
	AllowSplitUpdate() bool

	/* route hint always tx-block-level */
	SetCommitStrategy(value string)
	CommitStrategy() string

	BindParams() [][]byte
	SetBindParams([][]byte)

	BindParamFormatCodes() []int16
	SetParamFormatCodes([]int16)

	Params() map[string]string
	SetParam(name, value string)
	StartTx()
	ResetAll()
	Rollback()
	Savepoint(name string)
	CleanupStatementSet()
	ResetParam(name string)
	RollbackToSP(name string)
	CommitActiveSet()

	SetStartupParams(map[string]string)
}

func NewSimpleHandler

func NewSimpleHandler(t string, show_notice bool, ds string, defaultRouteBehaviour string) SessionParamsHolder

type SimpleSessionParamHandler

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

func (*SimpleSessionParamHandler) AllowSplitUpdate

func (cl *SimpleSessionParamHandler) AllowSplitUpdate() bool

AllowSplitUpdate implements client.Client.

func (*SimpleSessionParamHandler) AutoDistribution

func (cl *SimpleSessionParamHandler) AutoDistribution() string

AutoDistribution implements RouterClient.

func (*SimpleSessionParamHandler) BindParamFormatCodes

func (cl *SimpleSessionParamHandler) BindParamFormatCodes() []int16

BindParamFormatCodes implements RouterClient.

func (*SimpleSessionParamHandler) BindParams

func (cl *SimpleSessionParamHandler) BindParams() [][]byte

BindParams implements RouterClient.

func (*SimpleSessionParamHandler) CleanupStatementSet

func (cl *SimpleSessionParamHandler) CleanupStatementSet()

func (*SimpleSessionParamHandler) CommitActiveSet

func (cl *SimpleSessionParamHandler) CommitActiveSet()

func (*SimpleSessionParamHandler) CommitStrategy

func (cl *SimpleSessionParamHandler) CommitStrategy() string

func (*SimpleSessionParamHandler) DefaultRouteBehaviour

func (cl *SimpleSessionParamHandler) DefaultRouteBehaviour() string

DefaultRouteBehaviour implements RouterClient.

func (*SimpleSessionParamHandler) DistributedRelation

func (cl *SimpleSessionParamHandler) DistributedRelation() string

DistributedRelation implements RouterClient.

func (*SimpleSessionParamHandler) Distribution

func (cl *SimpleSessionParamHandler) Distribution() string

Distribution implements RouterClient.

func (*SimpleSessionParamHandler) DistributionKey

func (cl *SimpleSessionParamHandler) DistributionKey() string

DistributionKey implements RouterClient.

func (*SimpleSessionParamHandler) EnhancedMultiShardProcessing

func (cl *SimpleSessionParamHandler) EnhancedMultiShardProcessing() bool

ExecuteOn implements RouterClient.

func (*SimpleSessionParamHandler) ExecuteOn

func (cl *SimpleSessionParamHandler) ExecuteOn() string

ExecuteOn implements RouterClient.

func (*SimpleSessionParamHandler) GetTsa

func (cl *SimpleSessionParamHandler) GetTsa() tsa.TSA

func (*SimpleSessionParamHandler) MaintainParams

func (cl *SimpleSessionParamHandler) MaintainParams() bool

MaintainParams implements RouterClient.

func (*SimpleSessionParamHandler) Params

func (cl *SimpleSessionParamHandler) Params() map[string]string

func (*SimpleSessionParamHandler) PreferredEngine

func (cl *SimpleSessionParamHandler) PreferredEngine() string

PreferredEngine implements client.Client.

func (*SimpleSessionParamHandler) ResetAll

func (cl *SimpleSessionParamHandler) ResetAll()

func (*SimpleSessionParamHandler) ResetParam

func (cl *SimpleSessionParamHandler) ResetParam(name string)

func (*SimpleSessionParamHandler) ResetTsa

func (cl *SimpleSessionParamHandler) ResetTsa()

func (*SimpleSessionParamHandler) Rollback

func (cl *SimpleSessionParamHandler) Rollback()

func (*SimpleSessionParamHandler) RollbackToSP

func (cl *SimpleSessionParamHandler) RollbackToSP(name string)

func (*SimpleSessionParamHandler) Savepoint

func (cl *SimpleSessionParamHandler) Savepoint(name string)

func (*SimpleSessionParamHandler) ScatterQuery

func (cl *SimpleSessionParamHandler) ScatterQuery() bool

ScatterQuery implements RouterClient.

func (*SimpleSessionParamHandler) SetAllowSplitUpdate

func (cl *SimpleSessionParamHandler) SetAllowSplitUpdate(level string, val bool)

SetAllowSplitUpdate implements client.Client.

func (*SimpleSessionParamHandler) SetAutoDistribution

func (cl *SimpleSessionParamHandler) SetAutoDistribution(val string)

SetAutoDistribution implements RouterClient.

func (*SimpleSessionParamHandler) SetBindParams

func (cl *SimpleSessionParamHandler) SetBindParams(p [][]byte)

SetBindParams implements RouterClient.

func (*SimpleSessionParamHandler) SetCommitStrategy

func (cl *SimpleSessionParamHandler) SetCommitStrategy(val string)

func (*SimpleSessionParamHandler) SetDefaultRouteBehaviour

func (cl *SimpleSessionParamHandler) SetDefaultRouteBehaviour(level string, b string)

SetDefaultRouteBehaviour implements RouterClient.

func (*SimpleSessionParamHandler) SetDistributedRelation

func (cl *SimpleSessionParamHandler) SetDistributedRelation(level string, val string)

SetDistributedRelation implements RouterClient.

func (*SimpleSessionParamHandler) SetDistribution

func (cl *SimpleSessionParamHandler) SetDistribution(level string, val string)

SetDistribution implements RouterClient.

func (*SimpleSessionParamHandler) SetDistributionKey

func (cl *SimpleSessionParamHandler) SetDistributionKey(val string)

SetDistributionKey implements RouterClient.

func (*SimpleSessionParamHandler) SetEnhancedMultiShardProcessing

func (cl *SimpleSessionParamHandler) SetEnhancedMultiShardProcessing(level string, val bool)

SetExecuteOn implements RouterClient.

func (*SimpleSessionParamHandler) SetExecuteOn

func (cl *SimpleSessionParamHandler) SetExecuteOn(level string, val string)

SetExecuteOn implements RouterClient.

func (*SimpleSessionParamHandler) SetMaintainParams

func (cl *SimpleSessionParamHandler) SetMaintainParams(level string, val bool)

SetMaintainParams implements RouterClient.

func (*SimpleSessionParamHandler) SetParam

func (cl *SimpleSessionParamHandler) SetParam(name, value string)

func (*SimpleSessionParamHandler) SetParamFormatCodes

func (cl *SimpleSessionParamHandler) SetParamFormatCodes(paramCodes []int16)

SetParamFormatCodes implements RouterClient.

func (*SimpleSessionParamHandler) SetPreferredEngine

func (cl *SimpleSessionParamHandler) SetPreferredEngine(level string, val string)

SetPreferredEngine implements client.Client.

func (*SimpleSessionParamHandler) SetScatterQuery

func (cl *SimpleSessionParamHandler) SetScatterQuery(val bool)

SetScatterQuery implements RouterClient.

func (*SimpleSessionParamHandler) SetShardingKey

func (cl *SimpleSessionParamHandler) SetShardingKey(level string, k string)

SetShardingKey implements RouterClient.

func (*SimpleSessionParamHandler) SetShowNoticeMsg

func (cl *SimpleSessionParamHandler) SetShowNoticeMsg(level string, val bool)

SetShowNoticeMsg implements client.Client.

func (*SimpleSessionParamHandler) SetStartupParams

func (cl *SimpleSessionParamHandler) SetStartupParams(m map[string]string)

func (*SimpleSessionParamHandler) SetTsa

func (cl *SimpleSessionParamHandler) SetTsa(level string, s string)

func (*SimpleSessionParamHandler) SetUsr

func (cl *SimpleSessionParamHandler) SetUsr(u string)

SetUsr implements SessionParamsHolder.

func (*SimpleSessionParamHandler) ShardingKey

func (cl *SimpleSessionParamHandler) ShardingKey() string

ShardingKey implements RouterClient.

func (*SimpleSessionParamHandler) ShowNoticeMsg

func (cl *SimpleSessionParamHandler) ShowNoticeMsg() bool

ShowNoticeMsg implements RouterClient.

func (*SimpleSessionParamHandler) StartTx

func (cl *SimpleSessionParamHandler) StartTx()

func (*SimpleSessionParamHandler) Usr

Usr implements SessionParamsHolder.

Jump to

Keyboard shortcuts

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