SkillAgentSearch skills...

Charlatan

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.

Install / Use

/learn @guiyomh/Charlatan
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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 : 'freedom@gouv.co.uk'
        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)
View on GitHub
GitHub Stars5
CategoryDevelopment
Updated2y ago
Forks0

Languages

Go

Security Score

75/100

Audited on Mar 15, 2024

No findings