Categorygithub.com/grid-rbx/supabase-go
modulepackage
0.2.0
Repository: https://github.com/grid-rbx/supabase-go.git
Documentation: pkg.go.dev

# README

supabase-go

Unofficial Supabase client for Go. It is an amalgamation of all the libraries similar to the official Supabase client.

Installation

go get github.com/grid-rbx/supabase-go

Usage

import supabase "github.com/grid-rbx/supabase-go"

func main() {
  supabaseUrl := "<SUPABASE-URL>"
  supabaseKey := "<SUPABASE-KEY>"
  supabaseClient := supabase.CreateClient(supabaseUrl, supabaseKey)

  // Auth
  user, err := supabaseClient.Auth.SignIn(supabase.UserCredentials{
    email: "[email protected]",
    password: "password"
  })
  if err != nil {
    panic(err)
  }

  // DB
  var results map[string]interface{}
  err = supabaseClient.DB.From("something").Select("*").Single().Execute(&results)
  if err != nil {
    panic(err)
  }

  fmt.Println(results)

  // Storage
  supabaseClient.Storage.UploadFile("bucket-name", "file.txt", file)

  // Realtime
  supabaseClient.Realtime.Connect()

  channel, err := supabaseClient.Realtime.Channel(supabaseClient.Realtime.WithTable("realtime", "public", "my_table"))

  channel.OnInsert = func(m supabaseClient.Realtime.Message) {
    fmt.Println(m)
  }
}

Roadmap

  • Auth support (1)
  • DB support (2)
  • Realtime
  • Storage
  • Testing

(1) - Thin API wrapper. Does not rely on the GoTrue library for simplicity (2) - Through postgrest-go

I just implemented features which I actually needed for my project for now. If you like to implement these features, feel free to submit a pull request as stated in the Contributing section below.

Design Goals

It tries to mimick as much as possible the official Javascript client library in terms of ease-of-use and in setup process.

Contributing

Submitting a pull request

  • Fork it (https://github.com/grid-rbx/supabase-go/fork)
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

Contributors

# Functions

CreateClient creates a new Supabase client.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author