CubDB.start_link

You're seeing just the function start_link, go back to CubDB module for more information.
Link to this function

start_link(data_dir_or_options)

View Source

Specs

start_link(
  String.t()
  | [option() | {:data_dir, String.t()} | GenServer.option()]
) :: GenServer.on_start()

Starts the CubDB database process linked to the current process.

The argument is a keyword list of options:

  • data_dir: the directory path where the database files will be stored. This option is required. If the directory does not exist, it will be created. Only one CubDB instance can run per directory, so if you run several databases, they should each use their own separate data directory.

  • auto_compact: whether to perform compaction automatically. It defaults to true. See set_auto_compact/2 for the possible values

  • auto_file_sync: whether to force flush the disk buffer on each write. It defaults to true. If set to false, write performance is faster, but durability of writes is not strictly guaranteed. See set_auto_file_sync/2 for details.

GenServer options like name and timeout can also be given, and are forwarded to GenServer.start_link/3 as the third argument.

If only the data_dir is specified, it is possible to pass it as a single string argument.

Examples

# Passing only the data dir
{:ok, db} = CubDB.start_link("some/data/dir")

# Passing data dir and other options
{:ok, db} = CubDB.start_link(data_dir: "some/data/dir", auto_compact: true, name: :db)
Link to this function

start_link(data_dir, options)

View Source