Documentation ¶
Overview ¶
Copyright 2022 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func NewPostgreSQLQueryStateStore(logger logger.Logger, opts Options) state.Store
- func NewPostgreSQLStateStore(logger logger.Logger, opts Options) state.Store
- type MigrateOptions
- 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) (err 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
- type PostgreSQLQuery
- type Query
- func (q *Query) Finalize(filters string, qq *query.Query) error
- func (q *Query) VisitAND(f *query.AND) (string, error)
- func (q *Query) VisitEQ(f *query.EQ) (string, error)
- func (q *Query) VisitGT(f *query.GT) (string, error)
- func (q *Query) VisitGTE(f *query.GTE) (string, error)
- func (q *Query) VisitIN(f *query.IN) (string, error)
- func (q *Query) VisitLT(f *query.LT) (string, error)
- func (q *Query) VisitLTE(f *query.LTE) (string, error)
- func (q *Query) VisitNEQ(f *query.NEQ) (string, error)
- func (q *Query) VisitOR(f *query.OR) (string, error)
- type SetQueryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgreSQLQueryStateStore ¶
NewPostgreSQLQueryStateStore creates a new instance of PostgreSQL state store.
Types ¶
type MigrateOptions ¶
type Options ¶
type Options struct { MigrateFn func(context.Context, pginterfaces.PGXPoolConn, MigrateOptions) error SetQueryFn func(*state.SetRequest, SetQueryOptions) string ETagColumn string EnableAzureAD bool EnableAWSIAM 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) (err 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.
type PostgreSQLQuery ¶
type PostgreSQLQuery struct {
PostgreSQL
}
PostgreSQLQuery extends PostgreSQL to add querying capabilities
func (*PostgreSQLQuery) Features ¶
func (p *PostgreSQLQuery) Features() []state.Feature
Features returns the features available in this component.
func (*PostgreSQLQuery) Query ¶
func (p *PostgreSQLQuery) Query(parentCtx context.Context, req *state.QueryRequest) (*state.QueryResponse, error)
Query executes a query against store.