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

(edgedb.Client).WithConfig function does not seem to actually do anything #291

Closed
TomLisankie opened this issue Oct 27, 2023 · 2 comments
Closed

Comments

@TomLisankie
Copy link

Describe the bug
Using the (edgedb.Client).WithConfig does not seem to actually do anything. All other client functionality seems to work as expected

Reproduction

        conn, err = edgedb.CreateClient(context.Background(), edgedb.Options{
		Host:      host,
		Port:      edgedbPort,
		SecretKey: edgedbSecretKey,
	})
        // The below does not seem to actually do its job
	conn.WithConfig(map[string]interface{}{
		"allow_user_specified_id": true,
	})

Expected behavior
I expected this to achieve the same effect as if I ran the following EdgeQL:
configure instance set allow_user_specified_id := true;

Versions (please complete the following information):

  • OS: macOS Sonoma 14.0
  • EdgeDB version: 3.4+7598b99
  • EdgeDB CLI version: 3.5.0+e1ad387
  • edgedb-go version: 0.14.1-0.20230725211155-0d5d4814b9bd
  • Go version: 1.20

Additional context
I'm trying to do this on the setup of my API server in the context of docker-compose. The whole purpose of all of this is so I can run automated tests via GitHub Actions.
I ended up modifying my docker-compose.yml file to pass in an edgedb-bootstrap.yml as specified here so that I could at least make sure I was getting my config correct whether the Go library is working correctly or not.

@fmoor
Copy link
Member

fmoor commented Oct 28, 2023

The WithX methods return a new client with modified state. Try changing your example to something like this:

configuredClient := conn.WithConfig(map[string]interface{}{
	"allow_user_specified_id": true,
})
err := configuredClient.Query(...)

@raddevon
Copy link
Contributor

Closing this since it's been inactive for a while. Feel free to reopen if you're still having a problem, @TomLisankie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants