-
Notifications
You must be signed in to change notification settings - Fork 27
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
Provide examples for authentication etc. #20
Comments
If it's okay, could you post the code snippet of the part where you got the error? Or the error itself? |
Yeah sure, thanks! At first I tried something like this: connUrl := "http://" + user + ":" + password + "@" + host + ":" + port + "/" + dbName
client := postgrest.NewClient(connUrl, "public", nil)
res, err := client.From("my_table").Select("*", "", false).Execute()
if err != nil {
// I get an error from net/url: "invalid port \":myPassword after host"
panic(err)
}
fmt.Println(res) But having the credentials in the URL did not seem to work (even when I did Then I tried to use the TokenAuth method like this: client := postgrest.NewClient(connUrl, "public", nil)
client.TokenAuth("mySupabaseKey")
res, err := client.From("my_table").Select("*", "", false).Execute()
if err != nil {
// I get a net/url Error: "EOF"
panic(err)
} using the API key I got from the supabase settings. Does this look somewhat right to you // Edit |
Alright, so I was able to fix my problems! One of them was simply me doing mistakes (this is why I would love better docs), but I think I found two bugs as well?
|
Yes, there is some deficiency in the document part, I will complete those parts as soon as possible, I am also looking at the errors you sent. |
I'm looking at the pr you sent |
@muratmirgun There is still no example for the Auth on the README or at pkg.go.dev I am thinking about using Supabase for multiple projects, but I have to integrate it with my own backend, so a documentation how to connect with Authentication would be really nice for people like me. |
would also very much appreciate an auth example if this is possible |
Hey!
I love the idea behind this package, but have some troubles with getting started, as I am new to Supabase and PostgREST.
I would love to see some more examples on the usage of this package (with supabase), namely authentication.
client.TokenAuth
method?For anything I tried, I get some not-so-descriptive error (like just
EOF
from net/url) which is very likely because I did something wrong.All the examples I can find are just for a local setup without auth.
Maybe adding a few more tests would be ideal for this? I would love to contribute once I used this a bit more.
I would greatly appreciate any help :)
The text was updated successfully, but these errors were encountered: