Skip to content

CommandJoo/Supabase4j

Repository files navigation

Supa for Java

forthebadge

Description

Supa4J is a simple and easy to use API for java made to access Supabase-Tables, lets you delete, post, And update data.

Usage

First, you need to get an instance of the API

SupabaseApi api = new SupabaseApi()
            .url("https://yoursupabase.supabase.co")
            .apikey("SUPABASE-KEY")
            .log(false); //<- If you do not want requests to be logged to console

Once you have done that you're going to configure your request

 SupabaseRequest request = ((SupabaseRequestUpdate)SupabaseRequest.create("players")
        .method(MethodType.UPDATE))
        .filter("name", SupabaseOperators.EQUALS, "Tim")
        .postValue("{\"name\":\"Max\", \"age\":15}")

Finally to get the return value you have to actually send the request

SupabaseResponse response = api.build(request);