# Installation

## OCaml switch

Follow the online instructions to install opam.

Initialize your local switch, using opam:

opam switch create <switch_name> 4.12.0


## Library dependencies

Depending on the database backend you chose, you will need to setup some some configuration and install optional ocaml dependencies.

### Postgresql

Before installing the OCaml binding of postgresql, you need to install postgresql itself by following the online documentation.

To use postgresql with ocaml, you will to setup a user and configure it (requiring superuser).

make pg-user


After the configuration, you can install PGOCaml, the OCaml binding of postgres, in addition to other project dependencies. This can be achieved with:

make pg-deps


### LMDB

You only need to install the ocaml binding for lmdb, in addition to other project dependencies. This can be achieved with:

make lmdb-deps


### CAQTI

You only need to install the caqti-lwt and the caqti driver of your choice. This can be achieved with:

make caqti-deps


### Indexedb

You only need to install the ocaml binding for indexedDB, in addition to other project dependencies. This can be achieved with:

make idb-deps


## Building/Installing the binaries and library

If everything went well, you should be able to build crawlori with:

make


and install it in the opam switch with:

make install