CAVEAT (and note mostly to self)
The reasoning below may be deeply flawed; think this through a couple times with a fresh mind.
I don't like commanded/commanded being included in the dependencies because
it is a heavy one
this adapter is specifically for Commanded, and it will be included in a project if commanded/eventstore is used, therefore all the commanded modules will be available, thus the Commanded.EventStore behaviour as well.
As for checking behaviour conformity, I started looking into how adapters for Phoenix.PubSub and Phoenix.Ecto.SQL are implemented and it does seem to exist a uniform way.
Phoenix.PubSub is messy, and exactly the kind of solution that I would like to avoid here. Will do a write-up, but basically it requires implementing specific GenServer calls (?), without being backed by a behaviour or protocol. The containing phoenix_pubsub repo also contains the PG2 adapter implementation, and the separate Redis adapter includes phoenix_pubsub in its dependencies and calls modules in it directly.
The Ecto.Adapter behaviour seems well thought out, and sub-behaviours help to separate different functionality. The only problem is that I have still only scratched the surface, and it exponentially gets more complex when going into the adapter implementation themselves.
Bottom line: behaviour conformity will be informal and will come up with a plan.
CAVEAT (and note mostly to self) The reasoning below may be deeply flawed; think this through a couple times with a fresh mind.
I don't like
commanded/commanded
being included in the dependencies becausecommanded/eventstore
is used, therefore all the commanded modules will be available, thus theCommanded.EventStore
behaviour as well.As for checking behaviour conformity, I started looking into how adapters for
Phoenix.PubSub
andPhoenix.Ecto.SQL
are implemented and it does seem to exist a uniform way.Phoenix.PubSub
is messy, and exactly the kind of solution that I would like to avoid here. Will do a write-up, but basically it requires implementing specificGenServer calls
(?), without being backed by a behaviour or protocol. The containingphoenix_pubsub
repo also contains thePG2
adapter implementation, and the separateRedis
adapter includesphoenix_pubsub
in its dependencies and calls modules in it directly.The
Ecto.Adapter
behaviour seems well thought out, and sub-behaviours help to separate different functionality. The only problem is that I have still only scratched the surface, and it exponentially gets more complex when going into the adapter implementation themselves.Bottom line: behaviour conformity will be informal and will come up with a plan.