jdbcclient: JdbcClient on Spring Framework 7.0.10 / Boot 4.1.2, with twelve real transcripts
Parameters, row mapping, single/optional/list, generated keys, batch via NamedParameterJdbcTemplate (JdbcClient has none), exception translation, transactions, an unclosed stream() exhausting a 2-connection pool, withMaxRows truncating silently, and spring.jdbc.template.* reaching the auto-configured JdbcClient. JdbcClient API diffed across 6.1.0, 6.2.19 and 7.0.0. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5n3PRbPkUsiJybTeg
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
260c8a692f
commit
fc8bc933d5
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Which Spring Framework release added which JdbcClient method? Reads the real spring-jdbc jars from Maven Central
|
||||
# with javap and diffs the public signatures. Needs a JDK on PATH and network access to repo1.maven.org.
|
||||
# Writes output/13-api-diff.txt and output/14-default-jdbcclient.txt
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
W=target/api-diff; mkdir -p "$W" output
|
||||
VERSIONS=(6.1.0 6.2.0 6.2.19 7.0.0 7.0.10)
|
||||
for v in "${VERSIONS[@]}"; do
|
||||
[ -f "$W/spring-jdbc-$v.jar" ] || curl -sfo "$W/spring-jdbc-$v.jar" \
|
||||
"https://repo1.maven.org/maven2/org/springframework/spring-jdbc/$v/spring-jdbc-$v.jar"
|
||||
done
|
||||
sig() {
|
||||
javap -cp "$W/spring-jdbc-$1.jar" org.springframework.jdbc.core.simple.JdbcClient \
|
||||
'org.springframework.jdbc.core.simple.JdbcClient$StatementSpec' \
|
||||
'org.springframework.jdbc.core.simple.JdbcClient$ResultQuerySpec' \
|
||||
'org.springframework.jdbc.core.simple.JdbcClient$MappedQuerySpec' 2>/dev/null \
|
||||
| grep -v Compiled | sed 's/org\.springframework\.jdbc\.core\.simple\.//g; s/java\.lang\.//g; s/java\.util\.//g' | sort
|
||||
}
|
||||
{
|
||||
echo "public signatures of JdbcClient + StatementSpec + ResultQuerySpec + MappedQuerySpec, diffed between releases"
|
||||
prev=""
|
||||
for v in "${VERSIONS[@]}"; do
|
||||
sig "$v" > "$W/sig-$v.txt"
|
||||
echo "$v: $(wc -l < "$W/sig-$v.txt" | tr -d ' ') signatures"
|
||||
if [ -n "$prev" ]; then
|
||||
d=$(diff "$W/sig-$prev.txt" "$W/sig-$v.txt" | grep '^[<>]' || true)
|
||||
if [ -z "$d" ]; then echo " $prev -> $v: no change"; else echo " $prev -> $v:"; echo "$d" | sed 's/^/ /'; fi
|
||||
fi
|
||||
prev=$v
|
||||
done
|
||||
} > output/13-api-diff.txt
|
||||
{
|
||||
echo "DefaultJdbcClient (spring-jdbc 7.0.10), fields and constructors:"
|
||||
javap -p -cp "$W/spring-jdbc-7.0.10.jar" org.springframework.jdbc.core.simple.DefaultJdbcClient 2>/dev/null \
|
||||
| grep -E "private|public org" | sed 's/org\.springframework\.[a-z.]*\.//g; s/java\.[a-z]*\.//g; s/^ *//'
|
||||
} > output/14-default-jdbcclient.txt
|
||||
cat output/13-api-diff.txt output/14-default-jdbcclient.txt
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every file in output/ by running the test suite (in-memory H2, no Docker, no network after the first build).
|
||||
# The tests write the transcripts and assert the same facts, so a stale transcript fails the build.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
rm -f output/*.txt
|
||||
mvn -B -q test
|
||||
./scripts/api-diff.sh > /dev/null # outputs 13 and 14: reads spring-jdbc jars from Maven Central, needs the network
|
||||
echo "wrote:"; ls output
|
||||
Reference in New Issue
Block a user