Database on Linux

It looks like you are using Linux, if not go to the Windows or macOS page.

There are 2 options for databases, Postgres and SQLite. Look in the sections below for the right configuration.

SQLite

To install SQLite you need the following packages: sqlite3

You can install them using you default package manager:

# on Ubuntu/Debian
sudo apt-get install sqlite3

# on OpenSUSE
sudo zypper install libsqlite3-0 sqlite3

# on Fedora
sudo dnf install sqlite3x

Postgres

To install PostgreSQL you need to install the package: postgresql This will install the latest version of postgresql available for your system.

# Ubuntu/Debian
sudo apt-get install postgresql

Build from source

If you want to build DF Storyteller from source you need to install both SQLite and Postgres including there development packages.

# Ubuntu/Debian
sudo apt-get install libsqlite3-dev sqlite3 postgresql libpq-dev

# OpenSUSE (TODO: correct?)
sudo zypper install sqlite3-devel libsqlite3-0 sqlite3 postgresql-server libpq-devel

# Fedora (TODO: correct?)
sudo dnf install libsqlite3x-devel sqlite3x postgresql-server libpq-devel
To view the databases you can use sqlitebrowser and pgadmin4.
# Ubuntu/Debian
sudo apt-get install sqlitebrowser pgadmin4

To compile Rust code you need the Rust compiler. For more info: Install Rust We will then use Cargo to build the code. Cargo is the default build tool that is included with Rust. You are going to need the nightly toolchain, but cargo should automatically detect this. You can also install it using: rustup toolchain install nightly

Start building

To start building the application from source use the following code. During the build process below you should not get any warnings or errors. It you do, please open an issue.

# If you don't have git installed `apt-get install git`
# Clone git repo
git clone git@gitlab.com:df_storyteller/df-storyteller.git

# Move into the repo folder
cd ./df-storyteller

# Compile the code. 
# NOTE: This will max out all your cpu cores, use `--jobs 5` to only build 5 things at once or what number you want.
# The build process can take from 11 min (on 8 thread) up to 50 min (on 1 thread).
cargo build --release

# After the process is finished you can find the binary in:
# /target/release/df_storyteller
# or /target/release/df_storyteller_sqlite

# --Optional:--
# By default it will build the SQLite version.
# to build the Postgres version use:
cargo build --release --manifest-path df_st_cli/Cargo.toml --no-default-features --features "postgres" --bin df_storyteller_postgres

# This will build the postgres version in:
# /target/release/df_storyteller_postgres

If you are stuck there are also Docker files in the ./docker/ folder these include commands to install the container, they might help you.