View Source Litestream (Litestream v0.1.0-beta)

This GenServer module allows you to run Litestream via a port in the background so that you can easily backup your SQLite database to an object store.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

This function will start the Litestream process, if it is not currently running. If it is already running, then this operation is effectively a no-op.

The start_link/1 function is used to start the Litestream GenServer. After starting the GenServer, the process will download the Litestream binary and start it up to begin database replication. The Litestream GenServer expects a Keyword list with the following options

This function will cleanly stop the Litestream process, but the GenServer will still be running.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

start_lightstream(name \\ __MODULE__)

View Source

This function will start the Litestream process, if it is not currently running. If it is already running, then this operation is effectively a no-op.

The start_link/1 function is used to start the Litestream GenServer. After starting the GenServer, the process will download the Litestream binary and start it up to begin database replication. The Litestream GenServer expects a Keyword list with the following options:

  • :repo - The Ecto Repo that manages the SQLite database. REQUIRED
  • :replica_url - The URL to which the SQLite database should be backed up. REQUIRED
  • :access_key_id - The access key ID to the provided :replica_url. REQUIRED
  • :secret_access_key - The secret access key to the provided :replica_url. REQUIRED
  • :name - The name of the GenServer process. By default it is Litestream. OPTIONAL
Link to this function

stop_lightstream(name \\ __MODULE__)

View Source

This function will cleanly stop the Litestream process, but the GenServer will still be running.