Completely reasonable question! If you aren’t used to this pattern, it can be hard to know what to do here.
-
Pass a
:nameargument tostart_link— this will be forwarded to the underlying GenServer and accessible throughout your application. -
You probably don’t want to be calling
start_linkdirectly, but letting your application supervisor do so. So here’s the pattern you’re probably going to want to use:
children = [
{CubDB, data_dir: “some/dir”, name: :my_db}
]
Supervisor.start_link(children, strategy: :one_for_one)
You’d then use :my_db wherever you need to pass the db into the CubDB API.






















