Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres configuration store - getting configuration via client with metadata always returns empty result #3692

Open
majkio opened this issue Mar 9, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@majkio
Copy link

majkio commented Mar 9, 2025

Expected Behavior

Using Postgres configuration store and passing metadata via client
client.GetConfigurationItem(ctx, "configstore", "orderId2", dapr.WithConfigurationMetadata("version", "1.0.0"))
should build the query
SELECT * FROM config_table WHERE KEY IN ($1) AND version = $2

Actual Behavior

Currently the query is
SELECT * FROM config_table WHERE KEY IN ($1) AND $2 = $3
which always returns in empty result

Steps to Reproduce the Problem

  1. Create a Postgres configuration store (as described in docs)
  2. Store any configuration with version
    INSERT INTO config_table (key, value, version, metadata) VALUES ('orderId2', 'value', '1.0.0', null)
  3. Retrieve configuration (as described in docs) and pass version in metadata
package main

import (
	"context"
        "fmt"

	dapr "github.com/dapr/go-sdk/client"
)

func main() {
	ctx := context.Background()
	client, err := dapr.NewClient()
	if err != nil {
		panic(err)
	}
	item, err := client.GetConfigurationItem(ctx, "configstore", "orderId1", dapr.WithConfigurationMetadata("version", "1.0.0"))
	if err != nil {
		panic(err)
	}
        fmt.Printf("get config: key = orderId2 value = %s version = %s", (*item).Value, (*item).Version)
}

Release Note

RELEASE NOTE: FIX Postgres configuration store using metadata key as query parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant