From fd90830340d318b0d315a78d130cbe617b59f4e3 Mon Sep 17 00:00:00 2001 From: ~wispem-wantex Date: Sat, 14 Feb 2026 18:33:41 -0800 Subject: [PATCH] doc: add README.md --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ae3e0e --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# GAS stack + +## Compiling + +Requires a Go compiler (minimum 1.22.5) and a C compiler, due to use of CGo. + +```sh +git clone https://git.offline-twitter.com/offline-labs/gas-stack.git +cd gas-stack +go build -o gas -tags fts5 ./cmd + +# Installation (optional) +sudo mv gas /usr/local/bin # ...or anywhere on your $PATH +which gas # should print "/usr/local/bin/gas" +``` + +## Run the linter + +```sh +gas sqlite_lint +``` + +## Run the code generator + +```sh +gas generate table_name # Generates a model +gas generate --test table_name # Optional: generates tests +``` + +It prints to the console. You can copy-paste the result. Or you can use bash redirection: + +```sh +gas generate users > pkg/db/user.go +gas generate --test users > pkg/db/user_test.go +``` + +Useful flags: + +- `--schema`: by default, `gas generate` assumes that the schema is at `pkg/db/schema.sql`. Use `gas generate --schema [...]` to indicate otherwise