birdseed 0.1.2

birdseed enables you to seed a libellis database with fake data, clear all tables, or rebuild all tables per the current embedded migrations
Documentation

🐦 birdseed 🐦

Build Status MIT licensed crates.io

This crate's entire purpose is to seed the libellis database with fake data (generated by faker library).

Setup

You MUST set your DATABASE_URL environment variable to your libellis postgres database.

Example

$ export DATABASE_URL=postgres://username:password@localhost/libellis

You can optionally set this in a .env file in the root folder of this project if you are running the project from a local folder.

Installation

You may install this in one of two ways. If you have cargo installed then it's very easy. If not, you can install rust and cargo by following this very simple cargo setup process. Once you have cargo installed you can install this terminal application by running:

$ cargo install birdseed

Optionally you may instead clone this repo and in the root directory build the release version of this crate:

$ git clone https://github.com/libellis/birdseed.git
$ cd birdseed
$ cargo build --release

Features

feed

You can seed all databases with the feed subcommand:

$ birdseed feed

We can specify a row count (overriding the default of 1000 rows):

$ birdseed feed -r 10000

In this exampe we override the default of 1,000 rows and instead seed 10,000 rows.

Note: What the row count really means is that we will seed row count amount of users, surveys and questions, but row count * 4 amount of choices and votes.

clear

You can clear all tables with the clear subcommand:

$ birdseed clear

rebuild

You can rebuild all tables according to embedded diesel migrations

$ birdseed rebuild