aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-26 11:26:31 -0600
committerMarc Coquand <marc@mccd.space>2023-12-26 11:35:34 -0600
commita7c556e7a828a9be88e0893987396d652f0f3bde (patch)
treec9a6048ba7c2e7fa167451169cae866f6f2e7c53
parent0dcc905f2fdc89f3be834c670a5bcf42386eb663 (diff)
downloadfixgen-a7c556e7a828a9be88e0893987396d652f0f3bde.tar.gz
fixgen-a7c556e7a828a9be88e0893987396d652f0f3bde.tar.bz2
fixgen-a7c556e7a828a9be88e0893987396d652f0f3bde.zip
Update README
-rw-r--r--README.md24
-rw-r--r--dune-project3
-rw-r--r--fixgen.opam3
3 files changed, 22 insertions, 8 deletions
diff --git a/README.md b/README.md
index 0e3b6ae..e381d0e 100644
--- a/README.md
+++ b/README.md
@@ -8,12 +8,16 @@ Usually wiring up fake test data is a bunch of work, especially when that data i
- Supports relations
- Written in OCaml
+## Install
+
+Copy the binary to `/usr/local/bin`
+
## Usage
Fixgen makes it simple to generate fixtures. It comes with a tiny DSL:
```sh
-$ fixgen 'user (2): id uuidv4, name name; purchase (10): id uuidv4, buyer user.id, amount int<1,40>, currency: ("USD","MXN")' -o fixtures
+$ fixgen 'user (2): id uuidv4, name name; purchase (10): id uuidv4, buyer user.id, amount int(1,40), currency: ("USD","MXN")' -o fixtures
```
This will generate two files:
@@ -31,11 +35,21 @@ COPY purchases FROM '/fixtures/purchase.csv' CSV HEADER;
Or maybe export as JSON instead to import into your NoSQL DB.
```sh
-$ fixgen 'user (2): id uuidv4, name name; purchase (3): id uuidv4, buyer user.id, amount int<1,40>, currency: ("USD","MXN")' -f json
+$ fixgen 'user (2): id uuidv4, name name; purchase (3): id uuidv4, buyer user.id, amount int(1,40), currency: ("USD","MXN")' -f json
```
This will print two JSON arrays to stdout.
+### Supported types
+
+Fixgen comes with the following built-in types:
+
+- name
+- uuidv4
+- int(min,max)
+- constant, defined in quotes - `fixgen 'user (1): id uuiv4, name "Bob"'`
+- ("multiple","choices")
+
## Development - Prerequisites
- [Nix](https://nixos.org/manual/nix/stable/installation/installing-binary)
@@ -86,3 +100,9 @@ dune runtests
```
dune build
```
+
+### Contributing
+
+[Mailing list](https://lists.sr.ht/~marcc/public-inbox).
+
+Send your patches via [mail](mailto:~marcc/fixgen@lists.sr.ht). New to mailing patches? Check out this [tutorial](https://git-send-email.io/).
diff --git a/dune-project b/dune-project
index 5676cf0..6b155aa 100644
--- a/dune-project
+++ b/dune-project
@@ -4,9 +4,6 @@
(generate_opam_files true)
-(source
- (github username/reponame))
-
(authors "Marc Coquand")
(maintainers "Marc Coquand")
diff --git a/fixgen.opam b/fixgen.opam
index 338965e..988b773 100644
--- a/fixgen.opam
+++ b/fixgen.opam
@@ -5,9 +5,7 @@ description: "Generate fixtures for testing"
maintainer: ["Marc Coquand"]
authors: ["Marc Coquand"]
license: "AGPL-3.0-only"
-homepage: "https://github.com/username/reponame"
doc: "https://url/to/documentation"
-bug-reports: "https://github.com/username/reponame/issues"
depends: [
"ocaml"
"dune" {>= "3.11"}
@@ -32,4 +30,3 @@ build: [
"@doc" {with-doc}
]
]
-dev-repo: "git+https://github.com/username/reponame.git"