View Source Electric.TenantManager (electric v0.8.0)

Summary

Functions

Returns a specification to start this module under a supervisor.

Creates a new tenant for the provided database URL.

Deletes a tenant by its ID.

Retrieves the only tenant in the system. If there are no tenants, it returns {:error, :not_found}. If there are several tenants, it returns {:error, :several_tenants} and we should use get_tenant instead.

Retrieves a tenant by its ID.

Stores the provided tenant in the tenant manager.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create_tenant(tenant_id, connection_opts, opts \\ [])

View Source
@spec create_tenant(String.t(), Keyword.t(), Keyword.t()) :: :ok | {:error, atom()}

Creates a new tenant for the provided database URL.

Link to this function

delete_tenant(tenant_id, opts \\ [])

View Source
@spec delete_tenant(String.t(), Keyword.t()) :: :ok | :not_found

Deletes a tenant by its ID.

Link to this function

get_only_tenant(opts \\ [])

View Source
@spec get_only_tenant(Keyword.t()) ::
  {:ok, Keyword.t()} | {:error, :not_found} | {:error, :several_tenants}

Retrieves the only tenant in the system. If there are no tenants, it returns {:error, :not_found}. If there are several tenants, it returns {:error, :several_tenants} and we should use get_tenant instead.

Link to this function

get_tenant(tenant_id, opts \\ [])

View Source
@spec get_tenant(String.t(), Keyword.t()) :: {:ok, Keyword.t()} | {:error, :not_found}

Retrieves a tenant by its ID.

Link to this function

name(electric_instance_id)

View Source
Link to this function

store_tenant(tenant, opts)

View Source
@spec store_tenant(Keyword.t(), Keyword.t()) :: :ok | {:error, atom()}

Stores the provided tenant in the tenant manager.