View Source Ravix.Operations.Database.Maintenance (ravix v0.6.3)

Database maintenance operations module

Link to this section Summary

Link to this section Functions

Link to this function

create_database(store_or_pid, database_name, opts \\ [])

View Source
@spec create_database(atom() | pid(), nil | binary(), keyword()) ::
  {:error, any()} | {:ok, any()}

Creates a database using the informed request executor

Options:

  • :encrypted = true/false
  • :disabled = true/false
  • :replication_factor = 1-N

examples

Examples

iex> Ravix.Operations.Database.Maintenance.create_database(Ravix.Test.Store, "test_db")
{:ok,
%{
  "Name" => "test_db",
  "NodesAddedTo" => ["http://4e0373cbf5d0:8080"],
  "RaftCommandIndex" => 443,
  "Topology" => %{
    "ClusterTransactionIdBase64" => "mdO7gPZsMEeslGOxxNfpjA",
    "DatabaseTopologyIdBase64" => "0FHV8Uc0jEi94uZQiT00mA",
    "DemotionReasons" => %{},
    "DynamicNodesDistribution" => false,
    "Members" => ["A"],
    "NodesModifiedAt" => "2022-04-23T11:00:06.9470373Z",
    "PriorityOrder" => [],
    "Promotables" => [],
    "PromotablesStatus" => %{},
    "Rehabs" => [],
    "ReplicationFactor" => 1,
    "Stamp" => %{"Index" => 443, "LeadersTicks" => -2, "Term" => 4}
  }
}}
Link to this function

database_stats(store_or_pid, database_name \\ nil, opts \\ [])

View Source
@spec database_stats(atom() | pid(), nil | binary(), keyword()) ::
  {:error, any()} | {:ok, any()}
Link to this function

delete_database(store_or_pid, database_name, opts \\ [])

View Source
@spec delete_database(atom() | pid(), nil | binary(), keyword()) ::
  {:error, any()} | {:ok, any()}