View Source AshCubDB (ash_cubdb v0.6.2)
AshCubDB
is an Ash DataLayer
which adds support for persisting Ash resources with CubDB.
CubDB is an Elixir-based key value store which supports all Erlang-native terms. More information can be found in the CubDB readme.
Summary
Functions
Creates a backup of the database into the target directory path.
Deletes all entries, resulting in an empty database.
Runs a database compaction.
Returns true if a compaction operation is currently running, false otherwise.
Returns the path of the current database file.
Returns the path of the data directory, as given when the CubDB
process was started.
Returns the dirt factor.
Performs an fsync
, forcing to flush all data that might be buffered by the OS to disk.
Stops a running compaction.
Ensure that the CubDB process is running for the specified resource.
Stop the CubDB process running for a specific resource.
Functions
@spec back_up(Ash.Resource.t(), Path.t()) :: :ok | {:error, any()}
Creates a backup of the database into the target directory path.
Wrapper around CubDB.back_up/2
@spec clear(Ash.Resource.t()) :: :ok
Deletes all entries, resulting in an empty database.
Wrapper around CubDB.clear/1
@spec compact(Ash.Resource.t()) :: :ok | {:error, any()}
Runs a database compaction.
Wrapper around CubDB.compact/1
@spec compacting?(Ash.Resource.t()) :: boolean()
Returns true if a compaction operation is currently running, false otherwise.
Wrapper around CubDB.compacting?/1
@spec current_db_file(Ash.Resource.t()) :: String.t()
Returns the path of the current database file.
Wrapper around CubDB.current_db_file/1
@spec data_dir(Ash.Resource.t()) :: String.t()
Returns the path of the data directory, as given when the CubDB
process was started.
Wrapper around CubDB.data_dir/1
@spec dirt_factor(Ash.Resource.t()) :: float()
Returns the dirt factor.
Wrapper around CubDB.dirt_factor/1
@spec file_sync(Ash.Resource.t()) :: :ok
Performs an fsync
, forcing to flush all data that might be buffered by the OS to disk.
Wrapper around CubDB.file_sync/1
@spec halt_compaction(Ash.Resource.t()) :: :ok | {:error, :no_compaction_running}
Stops a running compaction.
Wrapper around CubDB.halt_compaction/1
@spec start(Ash.Resource.t()) :: {:ok, pid()} | {:error, any()}
Ensure that the CubDB process is running for the specified resource.
@spec stop(Ash.Resource.t()) :: :ok
Stop the CubDB process running for a specific resource.