-
Notifications
You must be signed in to change notification settings - Fork 11
fix: remove self managed client api #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a2e525
fix: deprecation of self managed clien
zoedsoupe aa0b877
chore: change deprecation message to only agent-based, not using macro
zoedsoupe 6793c62
fix!: remove agent self managed client
zoedsoupe f09903c
chore: update module docs
zoedsoupe 4b71c14
Merge branch 'main' into fix/self-managed-client
zoedsoupe ef8d044
chore: remove unecessary change
zoedsoupe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,30 @@ | ||
| defmodule Supabase.Client.Behaviour do | ||
| @moduledoc """ | ||
| The behaviour for the Supabase Client. This behaviour is used to define the API for a Supabase Client. | ||
| The behaviour for the Supabase Client. This behaviour defines a consistent | ||
| API for modules that provide Supabase client functionality. | ||
|
|
||
| If you're implementing a [Self Managed Client](https://github.com/zoedsoupe/supabase-ex?tab=readme-ov-file#self-managed-clients) as the [Supabase.Client](https://hexdocs.pm/supabase_potion/Supabase.Client.html), this behaviour is already implemented for you. | ||
| ## Usage | ||
|
|
||
| If you're implementing a [One Off Client](https://github.com/zoedsoupe/supabase-ex?tab=readme-ov-file#one-off-clients) as the [Supabase.Client](https://hexdocs.pm/supabase_potion/Supabase.Client.html), you need to implement this behaviour in case you want to use the integration with [Supabase.GoTrue](https://hexdocs.pm/supabase_gotrue/readme.html) for [Plug](https://hexdocs.pm/plug) based application or [Phoenix.LiveView](https://hexdocs.pm/phoenix_live_view) applications. | ||
| When you use the `Supabase.Client` macro in your module (similar to Ecto Repo), | ||
| this behaviour is automatically implemented for you: | ||
|
|
||
| defmodule MyApp.Supabase do | ||
| use Supabase.Client, otp_app: :my_app | ||
| end | ||
|
|
||
| This provides two callbacks: | ||
|
|
||
| - `get_client!/0` - Builds a fresh client struct from application config | ||
| - `set_auth!/1` - Updates the access token on a client instance | ||
|
|
||
| ## Custom Implementations | ||
|
|
||
| You can also implement this behaviour manually if you need custom client | ||
| initialization logic. | ||
| """ | ||
|
|
||
| alias Supabase.Client | ||
|
|
||
| @callback init :: {:ok, Client.t()} | {:error, Ecto.Changeset.t()} | ||
| @callback get_client :: {:ok, Client.t()} | {:error, :not_found} | ||
| @callback get_client(pid | atom) :: {:ok, Client.t()} | {:error, :not_found} | ||
| @callback set_auth(pid | atom, access_token :: String.t()) :: :ok | ||
|
|
||
| @optional_callbacks get_client: 0, get_client: 1, set_auth: 2 | ||
| @callback get_client! :: Client.t() | ||
| @callback set_auth!(access_token :: String.t()) :: Client.t() | ||
| end |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.