Documentation ¶
Index ¶
- func NewPostgreSQLStateStore(logger logger.Logger) state.Store
- func NewPostgreSQLStateStoreWithOptions(logger logger.Logger, opts Options) state.Store
- type Options
- type PostgreSQL
- func (p *PostgreSQL) BulkGet(parentCtx context.Context, req []state.GetRequest, _ state.BulkGetOpts) ([]state.BulkGetResponse, error)
- func (p *PostgreSQL) CleanupExpired() error
- func (p *PostgreSQL) Close() error
- func (p *PostgreSQL) Delete(ctx context.Context, req *state.DeleteRequest) error
- func (p *PostgreSQL) Features() []state.Feature
- func (p *PostgreSQL) Get(parentCtx context.Context, req *state.GetRequest) (*state.GetResponse, error)
- func (p *PostgreSQL) GetCleanupInterval() *time.Duration
- func (p *PostgreSQL) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
- func (p *PostgreSQL) GetDB() *pgxpool.Pool
- func (p *PostgreSQL) Init(ctx context.Context, meta state.Metadata) error
- func (p *PostgreSQL) Multi(parentCtx context.Context, request *state.TransactionalStateRequest) error
- func (p *PostgreSQL) Set(ctx context.Context, req *state.SetRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgreSQLStateStore ¶
NewPostgreSQLStateStore creates a new instance of PostgreSQL state store v2 with the default options. The v2 of the component uses a different format for storing data, always in a BYTEA column, which is more efficient than the JSONB column used in v1. Additionally, v2 uses random UUIDs for etags instead of the xmin column, expanding support to all Postgres-compatible databases such as CockroachDB, etc.
Types ¶
type Options ¶
type Options struct { // Disables support for authenticating with Azure AD // This should be set to "false" when targeting different databases than PostgreSQL (such as CockroachDB) NoAzureAD bool }
type PostgreSQL ¶
PostgreSQL state store.
func (*PostgreSQL) BulkGet ¶
func (p *PostgreSQL) BulkGet(parentCtx context.Context, req []state.GetRequest, _ state.BulkGetOpts) ([]state.BulkGetResponse, error)
func (*PostgreSQL) CleanupExpired ¶
func (p *PostgreSQL) CleanupExpired() error
func (*PostgreSQL) Delete ¶
func (p *PostgreSQL) Delete(ctx context.Context, req *state.DeleteRequest) error
Delete removes an item from the state store.
func (*PostgreSQL) Features ¶
func (p *PostgreSQL) Features() []state.Feature
Features returns the features available in this state store.
func (*PostgreSQL) Get ¶
func (p *PostgreSQL) Get(parentCtx context.Context, req *state.GetRequest) (*state.GetResponse, error)
Get returns data from the database. If data does not exist for the key an empty state.GetResponse will be returned.
func (*PostgreSQL) GetCleanupInterval ¶
func (p *PostgreSQL) GetCleanupInterval() *time.Duration
GetCleanupInterval returns the cleanupInterval property. This is primarily used for tests.
func (*PostgreSQL) GetComponentMetadata ¶
func (p *PostgreSQL) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
func (*PostgreSQL) GetDB ¶
func (p *PostgreSQL) GetDB() *pgxpool.Pool
func (*PostgreSQL) Multi ¶
func (p *PostgreSQL) Multi(parentCtx context.Context, request *state.TransactionalStateRequest) error
func (*PostgreSQL) Set ¶
func (p *PostgreSQL) Set(ctx context.Context, req *state.SetRequest) error
Set makes an insert or update to the database.