phasedb v0.0.2 PhaseDB.Database

Module for manipulating Database instances.

A database is simple a collection of Series.

Summary

Functions

Return a list of all databases available

Return a list of all series for a given database

Create a new database

Drop an existing database

Check if the database still exists

Retrieve an exlisting database

Return the name of a database

Return the pid of the given database process

Types

t :: %PhaseDB.Database{name: term}

Functions

all()

Specs

all :: [t]

Return a list of all databases available.

all_series(database)

Specs

all_series(t) :: [PhaseDB.Series.t]

Return a list of all series for a given database.

create(name)

Specs

create(name :: String.t) :: t | {:error, any}

Create a new database.

Only succeeds when the database doesn't already exist.

drop(database)

Specs

drop(t) :: :ok | {:error, any}

Drop an existing database.

Drops all series related to this database, then terminates the database process.

exists?(name)

Specs

exists?(t | String.t) :: boolean

Check if the database still exists.

get(name)

Specs

get(name :: String.t) :: t | {:error, any}

Retrieve an exlisting database.

Only succeeds when the database already exists.

name(database)

Specs

name(t) :: String.t

Return the name of a database.

pid_of(name)

Specs

pid_of(t | String.t) :: pid

Return the pid of the given database process.