Skip to content

v0.5.0

Latest
Compare
Choose a tag to compare
@zoedsoupe zoedsoupe released this 21 Sep 14:54
· 5 commits to main since this release
v0.5.0
d205d03

Supabase Potion 0.5.0 Release Notes

This release introduces several significant changes and improvements to the Supabase Potion library, making it easier to manage and interact with Supabase services from Elixir.

Important Changes:

  1. New Client Initialization Methods:

    • Supabase.init_client/3:
      • Added support for initializing a client directly with base_url and api_key as separate parameters.
      • This change simplifies the initialization process, making it more intuitive for users to create clients with different configurations.
    • Supabase.init_client!/3:
      • Introduced a bang version of the init_client/3 function, which raises an error if the client cannot be created.
      • Useful for scenarios where you need immediate feedback on client creation failures.
  2. Self-Managed Client Support:

    • The library now supports creating self-managed clients using Supabase.Client within your own modules.
    • This allows for the use of Agent processes to manage client state independently, ideal for long-running applications.
    • Example:
      defmodule MyApp.Supabase.Client do
        use Supabase.Client
      end
    • This approach facilitates better separation of concerns and modularization of client state management.
  3. Updated Configuration Options:

    • Enhanced configuration support for self-managed clients:
      • Now you can specify base_url, api_key, and other options directly in your config.exs file, which will be used by the client automatically.
      • This allows for a more flexible and centralized configuration of Supabase clients across your application.
    • Example configuration:
      config :supabase_potion, MyApp.Supabase.Client,
        base_url: "https://<app-name>.supabase.co",
        api_key: "<supabase-api-key>",
        conn: %{access_token: "<supabase-access-token>"},
        db: %{schema: "another"},
        auth: %{debug: true}
  4. Improved Client Retrieval:

    • Added Supabase.Client.get_client/1 to retrieve the client instance from the Agent process.
    • This function returns either the client or an error if the client process is not found, providing a reliable way to access client configurations.
  5. Better Error Handling for Missing Configurations:

    • Enhanced error messages for missing configuration keys like base_url and api_key.
    • Detailed error messages now guide users on how to configure these values using environment variables or directly in their configuration files.
  6. Updated Documentation:

    • The README has been updated with more detailed instructions on how to create and use both one-off and self-managed clients.
    • Added links to relevant documentation and resources to help users understand how to configure and interact with the library more effectively.

Migration Notes:

  • Dependency Update:

    • The version requirement for supabase_potion in the mix.exs file has been updated from ~> 0.4 to ~> 0.5. Make sure to update your mix.exs file accordingly:
      def deps do
        [
          {:supabase_potion, "~> 0.5"}
        ]
      end
  • Configuration Changes:

    • If you are using self-managed clients, ensure that you update your config.exs file with the new configuration structure.

This release aims to provide more flexibility and clarity in managing Supabase client configurations and initialization, catering to both simple and complex use cases. We hope you enjoy these enhancements!