supabase-community / postgrest-go

Isomorphic Go client for PostgREST. (Now Updating)
https://supabase.io
Apache License 2.0
170 stars 27 forks source link

❓ Can't get it to work. #27

Closed AlbinoGeek closed 2 years ago

AlbinoGeek commented 2 years ago

Synopsis

I can't get this package to function against supabase.co

Details

Whether I use the Anon key or the Service key, I can't select anything.

Reproduction

func TestSelect(t *testing.T) {
    db := postgrest.NewClient(
        "https://<project-ref>.supabase.co/rest/v1/",
        "public",
        map[string]string{},
    )
    db.TokenAuth("...")

    res, count, err := db.
        From("profiles").
        Select("*", "", false). // also tried specifying columns
        ExecuteString()

    spew.Dump(res, count, err)

    if err != nil {
        t.Fatalf("error returned: %v", err)
    }

    if res == "[]" || res == "" {
        t.Fatalf("no result")
    }
}
=== RUN   TestSelect
(string) (len=2) "[]"
(int64) 0
(interface {}) <nil>
    select_test.go:30: no result
--- FAIL: TestSelect (0.29s)
yusufpapurcu commented 2 years ago

Hey If you have time we can look into it on discord. You can pick a time after 5pm GMT 🙂

AlbinoGeek commented 2 years ago

It's now after 5PM GMT :)

I'd need an invite, or DM me -- I'm not on the Discord.

My nick is

Click to Expand

DamonB#4682