Skip to content

Commit

Permalink
Add a Makefile for the terrible sqlx codegen-in-workspace workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
zopieux committed Oct 1, 2021
1 parent 20fbfe6 commit b248e4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: sqlx
sqlx:
rm -rf target/sqlx
env -u DATABASE_URL SQLX_OFFLINE=false cargo check --workspace
$(eval DB=$(shell jq .db sqlx-data.json))
jq -s '{"db": $(DB)} + (INDEX(.hash)|to_entries|sort_by(.key)|from_entries)' target/sqlx/query-*.json > sqlx-data.json.tmp || ( rm sqlx-data.json.tmp && exit 1 )
mv -f sqlx-data.json.tmp sqlx-data.json

0 comments on commit b248e4b

Please sign in to comment.