sqlc: add support for code generation

This commit is contained in:
positiveblue
2023-05-26 16:06:01 -07:00
parent 481a8f5a47
commit f0c27c896c
3 changed files with 41 additions and 0 deletions

20
scripts/gen_sqlc_docker.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
# Directory of the script file, independent of where it's called from.
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
# Use the user's cache directories
GOCACHE=`go env GOCACHE`
GOMODCACHE=`go env GOMODCACHE`
echo "Generating sql models and queries in go..."
docker run \
--rm \
--user "$UID:$(id -g)" \
-e UID=$UID \
-v "$DIR/../:/build" \
-w /build \
kjconroy/sqlc:1.18.0 generate