Adding properly
The .git folder messed up the initial commit.
This commit is contained in:
29
internal/liteq/Makefile
Normal file
29
internal/liteq/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
default:
|
||||
go run *.go || (go get ./... && go run *.go)
|
||||
|
||||
watch:
|
||||
(watchexec -e sql -- make schema-const) & \
|
||||
(watchexec -e sql -- sqlc generate) & \
|
||||
(watchexec -w sqlc.yaml -- sqlc generate) & \
|
||||
(watchexec -e go -c -r -- go test ./... -count 1) & \
|
||||
wait
|
||||
# SQL Watcher done
|
||||
|
||||
# Puts the schema in a constant in go so it can be used to create the table directly
|
||||
schema-const:
|
||||
echo "// Code generated by Makefile. DO NOT EDIT." > internal/schema.go
|
||||
echo "package internal\n" >> internal/schema.go
|
||||
echo "const Schema = \`" >> internal/schema.go
|
||||
cat db/schema.sql >> internal/schema.go
|
||||
echo "\`" >> internal/schema.go
|
||||
|
||||
|
||||
.PHONY: bench
|
||||
bench:
|
||||
make cleanup
|
||||
make schema-const
|
||||
sqlc generate
|
||||
cd bench && go run main.go
|
||||
|
||||
cleanup:
|
||||
rm -f bench/bench.db*
|
||||
Reference in New Issue
Block a user