GAS stack
Compiling
Requires a Go compiler (minimum 1.22.5) and a C compiler, due to use of CGo.
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
gas sqlite_lint <path/to/schema.sql>
Run the code generator
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:
gas generate users > pkg/db/user.go
gas generate --test users > pkg/db/user_test.go
Useful flags:
--schema: by default,gas generateassumes that the schema is atpkg/db/schema.sql. Usegas generate --schema <path/to/schema.sql> [...]to indicate otherwise
Description
Languages
Go
93.6%
Shell
4.2%
Smarty
1.1%
Dockerfile
1.1%