tools: add sqlc generation tools

This commit is contained in:
sputn1ck 2023-05-17 19:05:34 +02:00
parent 5d9d7c5c6e
commit 5c07c20d16
No known key found for this signature in database
GPG key ID: 671103D881A5F0E4
5 changed files with 1321 additions and 74 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.17.2 generate