Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class Supabase
- Object
- Supabase
A Supabase client in pure Java over the project’s REST endpoints: PostgREST queries, GoTrue auth, Storage and Realtime.
Requests carry the anon key and, once a user signs in, the user’s access token, so your row level security policies apply. An expired session is refreshed before a request, and a 401 refreshes it once and retries.
Supabase supabase = new Supabase("https://xyzcompany.supabase.co", "public-anon-key");
supabase.from("countries").select("id,name").eq("continent", "Europe").order("name", true).limit(10)
.execute().ready(new SuccessCallback<List<Map<String, Object>>>() {
public void onSucess(List<Map<String, Object>> rows) {
Log.p("Got " + rows.size() + " countries");
}
});Constructors
public Supabase(String url, String anonKey) | Creates a client. |
Methods
public String getUrl() | The project URL without a trailing slash. |
public String getKey() | The anon key. |
public void setTransport(CloudHttpTransport transport) | Replaces the HTTP transport, for tests or a custom stack. |
public SupabaseAuth auth() | The GoTrue auth client. |
public PostgrestQuery from(String table) | Starts a PostgREST query or write on a table or view. |
public SupabaseStorage storage() | The Storage client. |
public SupabaseRealtime realtime() | The Realtime client. |
Inherited methods
Constructor details
Supabase
public Supabase(String url, String anonKey)Creates a client.
Parameters
urlString- the project URL,
https://xyzcompany.supabase.co anonKeyString- the project’s anon (public) key
Method details
getUrl
public String getUrl()The project URL without a trailing slash.
Returns
the URL
getKey
public String getKey()The anon key.
Returns
the key
setTransport
public void setTransport(CloudHttpTransport transport)Replaces the HTTP transport, for tests or a custom stack.
Parameters
transportCloudHttpTransport- the transport
auth
public SupabaseAuth auth()The GoTrue auth client.
Returns
the auth client
from
public PostgrestQuery from(String table)Starts a PostgREST query or write on a table or view.
Parameters
tableString- the table name
Returns
a new query builder
storage
public SupabaseStorage storage()The Storage client.
Returns
the storage client
realtime
public SupabaseRealtime realtime()The Realtime client.
Returns
the realtime client