B4A Library [B4X] Supabase - The Open Source Firebase alternative

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.13
    • General
      • Add get and set LogEvents - If true then you get debugging infos in the log
      • Add Some infos to log messages
    • Auth
      • BugFix
    • Database
      • Add OrderBy
      • Add Limit
      • Add Offset
Database
B4X:
    Dim Query As Supabase_DatabaseSelect = xSupabase.Database.SelectData
    Query.Columns("*").From("dt_Tasks")
    Query.OrderBy("Tasks_Id.desc")
    Query.Limit(1)
    Query.Offset(1)
    Wait For (Query.Execute) Complete (DatabaseResult As SupabaseDatabaseResult)
    xSupabase.Database.PrintTable(DatabaseResult)
 

Waldemar Lima

Well-Known Member
Licensed User
Is there a way to check if the URL & AnonKey are valid without breaking the application ?
because in supabase for free tier customers they run the risk of having the project "paused"...
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.15
    • Realtime
      • Add support for Presence and Broadcast
        • Presence: Share state between users with Realtime Presence.
        • Broadcast: Send and receive messages using Realtime Broadcast
      • Add new enums
        • get Event_Sync - Presence only
        • get Event_Join - Presence only
        • get Event_Leave - Presence only
      • Add support for multi event subscribe
      • Add SendBroadcast
      • Add Event BroadcastDataReceived
      • Add Event PresenceDataReceived
Added 3 new tutorials:
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.16
    • Auth
      • BugFixes
    • Realtime
      • Add Event Disconnected
New example app:
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.19
    • Database
      • Add SelectData to INSERT - Create a record and return it
      • Add SelectData to UPDATE - Update a record and return it
      • BreakingChange on Supabase_DatabaseInsert
        • The return value for execute is no longer of type SupabaseError it is now SupabaseDatabaseResult
      • BreakingChange on Supabase_DatabaseUpdate
        • The return value for execute is no longer of type SupabaseError it is now SupabaseDatabaseResult
Works with UPSERT too
B4X:
    Dim Insert As Supabase_DatabaseInsert = xSupabase.Database.InsertData
    Insert.From("users")
    Insert.Upsert
    Insert.SelectData
    Dim InsertMap As Map = CreateMap("id":"492422e5-4188-4b40-9324-fee7c46be527","username":"Alex")
    Wait For (Insert.Insert(InsertMap).Execute) Complete (Result As SupabaseDatabaseResult)
    xSupabase.Database.PrintTable(Result)

B4X:
    Dim Update As Supabase_DatabaseUpdate = xSupabase.Database.UpdateData
    Update.From("users")
    Update.Update(CreateMap("username":"Alex"))
    Update.SelectData
    Update.Eq(CreateMap("id":"492422e5-4188-4b40-9324-fee7c46be527"))
    Wait For (Update.Execute) Complete (Result As SupabaseDatabaseResult)
    xSupabase.Database.PrintTable(Result)
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.20
    • Database
      • Support for json columns
        • the json string of the column must look like this to be recognized: [{"name":"Volleyball","id":1}]
          • Important that it starts with [ and ends with ]
I have a json column that returns a json string. The problem is that the supabase api also returns the data as a json string. So the json parser does not know that it should not touch this part. So I check if the value is a list and if this is true then I generate a json string from it again.
I don't know if this is the right way and if this will be a problem later. But I don't know how to solve the whole thing differently.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.22
    • Auth
      • BugFixes on SignUp
      • Add LogIn_Anonymously - Allow your users to sign up without requiring users to enter an email address, password
      • Add isAnonymous to SupabaseUser
      • BugFixes on oAuth
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…