Skip to content

Relying on brianvoe/gofakeit, Charlatan allows you to create a ton of fixtures/fake data for use while developing or testing your project. It is inspired by nelmio/alice.It gives you a few essential tools to make it very easy to generate complex data in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed.

License

Notifications You must be signed in to change notification settings

guiyomh/charlatan

Repository files navigation

CI Go Report Card codecov

Charlatan - Expressive fixtures generator

Relying on brianvoe/gofakeit, Charlatan allows you to create a ton of fixtures/fake data for use while developing or testing your project. It is inspired by nelmio/alice.It gives you a few essential tools to make it very easy to generate complex data in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed.

Table of content

  1. Installation
  2. Example
  3. Complete Reference
  4. Handling Relations
  5. Data generator

Installation

First, get it:

go get -u github.com/guiyomh/charlatan

Example

Here is a complete example of a declaration:

user:
    user_tpl (template):
        first_name: '{firstname}'
        last_name: '{lastname}'
        pseudo: '{username}'
        password: '{words:2,true}'
        email : '{email}'
    admin_1:
        first_name: 'William'
        last_name: 'Wallace'
        pseudo: 'WW'
        password: 'freedommmmmmm'
        email : '[email protected]'
        isAdmin: true
    admin_{2..5} (extends user_tpl):
        isAdmin: true
    user_{bob,harry,george} (extends user_tpl):
        isAdmin: false

You can then load them easily with:

charlatan load --fixtures ./fixtures --user=<your_db_user> --dbname=<your_dbname> --pass=<your_db_pass>

Compatible databases

  • MySQL / MariaDB
  • PostgreSQL (in progress)

About

Relying on brianvoe/gofakeit, Charlatan allows you to create a ton of fixtures/fake data for use while developing or testing your project. It is inspired by nelmio/alice.It gives you a few essential tools to make it very easy to generate complex data in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages