defp package do
[
name: :uni_ecto_plugin,
licenses: ["MIT"],
links: %"GitHub" => "https://github.com/your/uni_ecto_plugin"
]
end
mix hex.build
mix hex.publish
First, let's clarify the terminology. In the Elixir ecosystem, the term uni often refers to Universal Multi-Tenancy. The uni_ecto_plugin (typically found in libraries like triplex or the more modern ash_archival variants, or specifically the Uni package family) is a set of macros and helper functions that transform your standard Ecto repo into a multi-tenant powerhouse.
Unlike basic foreign key scoping (WHERE tenant_id = ?), the uni_ecto_plugin often supports database-level isolation (separate schemas or separate databases). It seamlessly switches between tenants at the connection level. uni ecto plugin
Key features typically provided:
case UserRegistration.run(%email: "alice@example.com", name: "Alice") do
:ok, %update_role: user ->
IO.inspect(user, label: "Registered user")
:error, step_name, error, _ctx ->
IO.puts("Failed at step #step_name: #inspect(error)")
end
Key observation: Each step’s result is automatically stored under its step name (:insert_user, :update_role) inside the pipeline context. The named access (ctx.data.insert_user) makes dependencies explicit and traceable. defp package do [ name: :uni_ecto_plugin, licenses: ["MIT"],
While there isn't a "drag-and-drop" library called uni-ecto-plugin, the concept defines a modern architectural standard. It requires building a reactive adapter that respects the lazy nature of the Uni type while leveraging the robust query power of Ecto. mix hex
For developers working in mixed-language environments, mastering this bridge allows you to utilize Elixir for what it does best (data processing/concurrency) and Java for what it does best (enterprise integration), all while maintaining a fully non-blocking, reactive stack.