Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlserver

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger logger.Logger) state.Store

New creates a new instance of a SQL Server transaction store.

Types

type IndexedProperty

type IndexedProperty struct {
	ColumnName string `json:"column"`
	Property   string `json:"property"`
	Type       string `json:"type"`
}

IndexedProperty defines a indexed property.

type KeyType

type KeyType string

KeyType defines type of the table identifier.

const (
	// StringKeyType defines a key of type string.
	StringKeyType KeyType = "string"

	// UUIDKeyType defines a key of type UUID/GUID.
	UUIDKeyType KeyType = "uuid"

	// IntegerKeyType defines a key of type integer.
	IntegerKeyType KeyType = "integer"

	// InvalidKeyType defines an invalid key type.
	InvalidKeyType KeyType = "invalid"
)

func KeyTypeFromString

func KeyTypeFromString(k string) (KeyType, error)

KeyTypeFromString tries to create a KeyType from a string value.

type SQLServer

type SQLServer struct {
	state.BulkStore
	// contains filtered or unexported fields
}

SQLServer defines a MS SQL Server based state store.

func (*SQLServer) BulkGet added in v1.18.0

BulkGet retrieves multiple entities in a single round-trip per chunk using a `WHERE [Key] IN (...)` query. When the number of requested keys exceeds the configured BulkGetChunkSize, BulkGet issues multiple chunked queries sequentially (not in parallel) and merges the results. This avoids SQL Server's hard 2100-parameter limit and reduces connection-pool pressure versus the default per-key fan-out.

The default chunk size is 1000, so callers with <= 1000 keys see a single query.

func (*SQLServer) CleanupExpired

func (s *SQLServer) CleanupExpired() error

func (*SQLServer) Close

func (s *SQLServer) Close() error

Close implements io.Closer.

func (*SQLServer) Delete

func (s *SQLServer) Delete(ctx context.Context, req *state.DeleteRequest) error

Delete removes an entity from the store.

func (*SQLServer) Features

func (s *SQLServer) Features() []state.Feature

Features returns the features available in this state store.

func (*SQLServer) Get

Get returns an entity from store.

func (*SQLServer) GetCleanupInterval

func (s *SQLServer) GetCleanupInterval() *time.Duration

GetCleanupInterval returns the cleanupInterval property. This is primarily used for tests.

func (*SQLServer) GetComponentMetadata

func (s *SQLServer) GetComponentMetadata() (metadataInfo metadata.MetadataMap)

func (*SQLServer) Init

func (s *SQLServer) Init(ctx context.Context, metadata state.Metadata) error

Init initializes the SQL server state store.

func (*SQLServer) Multi

Multi performs batched updates on a SQL Server store.

func (*SQLServer) Set

func (s *SQLServer) Set(ctx context.Context, req *state.SetRequest) error

Set adds/updates an entity on store.

Jump to

Keyboard shortcuts

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