⨯ FetcherError: dbname: invalid branch name when using client@next ts sdk
Hi, I'm trying to use Xata with postgres enabled via the @next ts sdk.
Firstly, the client generation seems broken, as mentioned in my previous post.
But secondly, when I try and make a request I'm getting:
⨯ FetcherError: mydbname: invalid branch name
However when I inspect the client config, the config via await xata.getConfig();
, correct branch name seems to be present...
Any help with this would be much appreciated.4 Replies
Hey Adam, I'm looking into this now.
Can you paste the code for the query you're running and also how you're initialising the client?
I haven't been able to reproduce locally with
xata.io/client@^0.0.0-next.veed33633c02b9411aecf8f69d8c94071c9257c12
and xata.io/cli/0.0.0-next.veed33633c02b9411aecf8f69d8c94071c9257c12
on a Postgres enabled branch.
Also, we just deployed a fix for some issues around our feature flags and Postgres branches, I think this might have resolved your issue (🤞) so if you could give it another try that would be awesomeHi @emily thanks for the response.
I'm instantiating the client via:
and accessing the data via a data access layer in a nextjs app. Here is the fn in the data access layer:
@emily how do I check if postgres is enabled on a branch?
I definitely enabled it when I initially created the db, but since then I created a new
dev
branch to rule out a bug due to a branch name containing hyphens. Now I can't see any flags in the UI indicating whether postgres is enabled...If it shows the elephant icon it is
Also if you tell me the name I can check
yeah, all the branches in your workspace are Postgres enabled, so that's not the issue
ah, I think I know. How does the XATA_DATABASE_URL look for you? It should not contain the branch name.
For example, this works for me:
if I add
:main
to it, I get a similar error as you do@tsg yes, that was it - thank you!