Create an Ecto adapter for the Cub DB library.
Although the BEAm ecosystem have multiple databases as ETS, DETS, or Mnesia, there are few options for sql-like storage engines.
Our idea is create an Ecto Adapter for Cub DB
, a embedded key-value database written in Elixir.
We considered create an adapter for other options, but we choosed Cub DB because it's relative newest in the ecosystem and it looks like a great opportunity to contribute.
Other projects that we found to take inspiration and guidance were:
- Contribute to grow the tools for Cub DB
- Learn about
Ecto Adapters
- Search similar projects and explore them to see how they are implementing their adapters
- Leverage Ecto.Repo for basic CRUD calls.
- Leverage Ecto.Query for composing more complex calls.
Installation through github:
def deps do
[
{:cub_ecto, git: "git@github.com:chouzar/cubecto.git", branch: "main"}
]
end
- Implement
Ecto.Adapter
- Create our own
Repo
and start the Cube DB process - Implement
Ecto.Adapter.Schema
- Autogenerate UUIDS for inserts
- Insert a schema
- Delete a schema
- Implement
Ecto.Adapter.Queryable
We focused on implement the Ecto.Adapter and be able to insert a schema:
- Implement:
insert all
,update
- Implement the
execute/5
function from Ecto.Adapter.Queryable to make searches - Add tests, clean the code and add refactors
You can download our video here: (MOV file) Download Video Demo