https://github.com/guiyomh/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.
https://github.com/guiyomh/charlatan
database expression-language faker fixture fixtures golang testing
Last synced: about 1 year ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/guiyomh/charlatan
- Owner: guiyomh
- License: agpl-3.0
- Created: 2018-10-04T12:10:16.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T14:14:41.000Z (almost 3 years ago)
- Last Synced: 2025-03-27T01:06:35.232Z (about 1 year ago)
- Topics: database, expression-language, faker, fixture, fixtures, golang, testing
- Language: Go
- Homepage:
- Size: 77.1 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/guiyomh/charlatan/actions/workflows/ci.yaml)
[](https://goreportcard.com/report/github.com/guiyomh/charlatan)
[](https://codecov.io/gh/guiyomh/charlatan)
# Charlatan - Expressive fixtures generator
Relying on [brianvoe/gofakeit](https://github.com/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](https://github.com/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](#Installation)
2. [Example](#Example)
3. [Complete Reference](doc/reference.md)
4. [Handling Relations](doc/handling-relations.md)
5. [Data generator](https://github.com/brianvoe/gofakeit/blob/master/README.md#120-functions)
## Installation
First, get it:
```shell
go get -u github.com/guiyomh/charlatan
```
## Example
Here is a complete example of a declaration:
```yaml
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:
```bash
charlatan load --fixtures ./fixtures --user= --dbname= --pass=
```
## Compatible databases
* MySQL / MariaDB
* PostgreSQL (in progress)