No description
| cmd/server | Adds forms SQL table, seed data, and /test route | |
| pkg | Adds forms SQL table, seed data, and /test route | |
| testdata/db/forms | Updates README | |
| .editorconfig | Initial commit | |
| .gitignore | Adds forms SQL table, seed data, and /test route | |
| go.mod | Adds sqlite as well as db and handlers pkgs | |
| go.sum | Adds sqlite as well as db and handlers pkgs | |
| README.md | Updates README | |
frms
No bullshit 1-file forms.
Developing
You'll need the following tools:
If you modify any of the *.templ files in pkg/templs then you need to generate
the new *.go files for them before compiling.
❯ templ generate -path ./pkg/templs
Processing path: /Users/erik/Code/limeleaf/frms/pkg/templs
Generating production code: /Users/erik/Code/limeleaf/frms/pkg/templs
(✓) Generated code for "/Users/erik/Code/limeleaf/frms/pkg/templs/layout.templ" in 1.420083ms
(✓) Generated code for 1 templates with 0 errors in 1.599417ms
Running
> go run ./cmd/server
Seeding Database
The ./testdata/db directory contains seed data. All directories within db
will be created as tables (provided there are .json files within) and each
.json file will be inserted as an individual row within those tables. The ID
of the row will be the name of the file without the extension.
If you want to seed the database with some data you can run:
❯ go run ./cmd/server --db-seed-dir ./testdata/db
Feel free to add more .json files for more data. To re-seed a new databse just
delete the database file on disk first or else you'll see key contraint errors.