jooq: jOOQ 3.21.9 on Spring Boot 4.2.0 - codegen from Flyway migrations, typed queries, MULTISET, transactions, Testcontainers, fourteen real transcripts
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7h4ZNF4BDUpJk3Zou
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
8d8c28e2e5
commit
3f061c5e5d
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
# Shows what the compiler says in three situations. Works on a throwaway copy of the module.
|
||||
# A. wrong Java type in a condition (BOOK.PRICE.eq("12.50"))
|
||||
# B. a column name typo (BOOK.ISBNN)
|
||||
# C. the schema changes under existing code (regenerate WITHOUT migration V2: BOOK.ISBN disappears)
|
||||
set -uo pipefail
|
||||
HERE="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
OUT="$HERE/output/10-compile-errors.txt"
|
||||
WORK="$(mktemp -d)"
|
||||
filter() { sed -e '/Failed to execute goal/,$d' | grep -v -E 'Picked up|^WARNING|COMPILATION ERROR|^\[ERROR\] *$|^[[:space:]]*$' | sed -e "s#/tmp/[^ ]*/m/##" -e 's/^\[ERROR\] //' -e 's/\x1b\[[0-9;]*m//g'; }
|
||||
|
||||
mkdir -p "$WORK/m" && cp -r "$HERE/pom.xml" "$HERE/src" "$HERE/scripts" "$WORK/m/"
|
||||
cd "$WORK/m"
|
||||
: > "$OUT"
|
||||
|
||||
echo "== A. wrong type: BOOK.PRICE.eq(\"12.50\") ==" >> "$OUT"
|
||||
cp "$HERE/src/broken/WrongType.java" src/main/java/com/ankurm/jooq/
|
||||
mvn -B -q compile 2>&1 | filter >> "$OUT"
|
||||
rm src/main/java/com/ankurm/jooq/WrongType.java
|
||||
|
||||
echo >> "$OUT"; echo "== B. typo: BOOK.ISBNN ==" >> "$OUT"
|
||||
cp "$HERE/src/broken/Typo.java" src/main/java/com/ankurm/jooq/
|
||||
mvn -B -q compile 2>&1 | filter >> "$OUT"
|
||||
rm src/main/java/com/ankurm/jooq/Typo.java
|
||||
|
||||
echo >> "$OUT"; echo "== C. regenerate from schema version 1 only (no isbn column), compile the unchanged application ==" >> "$OUT"
|
||||
"$WORK/m/scripts/codegen.sh" -Dflyway.target=1 > /dev/null 2>&1
|
||||
mvn -B -q compile 2>&1 | filter >> "$OUT"
|
||||
cd "$HERE"; rm -rf "$WORK"
|
||||
cat "$OUT"
|
||||
Reference in New Issue
Block a user