rngo

Tutorial

First Steps

In this tutorial, we will iterate on a rngo-enabled project, starting from scratch and working our way up to higher-level functionality.

First, if you haven't already, install the rngo CLI and authenticate:

> npm install -g rngo
> rngo auth

Make a directory for the project and cd into it. Add a config.yml file with the following content:

streams:
  users:
    schema:
      type: object
      properties:
        id:
          type: integer
        full_name:
          type: string
        created_at:
          type: string
      required:
        - id
        - full_name
        - created_at

This file configures a single stream, which defines the schema, content and volume of simulated data. At a minimum, a stream must have a name - "users" in this case - and a JSON Schema - a contrived user model for now.

Run rngo sim --config config.yml. This command runs a simulation based upon the specified config and outputs the data to a new simulation directory.

So, you should see a data file at .rngo/simulations/last/streams/users/001.json. The file's contents will contain lines that look like this:

{"id":42673877,"created_at":"#1@Lz*F;cVsVLW10iZN5la/>`w)?}Mw0d$G","full_name":"#1@Lz*F;cVsVLW10iZN5la/>`w)?}Mw0d$G"}
{"id":-63629667, "created_at":"l p I3qH4\"@","full_name":"l p I3qH4\"@"}

Congratulations, you've generated some highly unrealistic data with rngo!

Previous
Postgres Quick Start