Conformance: throwable chaining, URL ctor/getProtocol, ClassLoader/Thread shims

Surfaced running the DB libraries (migratus) on the jolt db library:
- java.sql.SQLException .getNextException / .getStackTrace / .printStackTrace on
  jolt throwables (conditions + ex-info) return nil/empty, so a library walking
  the exception chain doesn't crash.
- java.net.URL ctor + .getProtocol (file/http), alongside the existing url shim.
- A generic java.lang.ClassLoader: getSystemClassLoader / a thread's
  contextClassLoader resolve a named resource against the source roots (the same
  model as clojure.java.io/resource) — file: URL or nil. Thread/currentThread.
  These are generic host capabilities, not DB-specific.

The jolt-lang/db next.jdbc surface now runs migratus far enough to connect, build
the migrations table, and discover migrations; migratus's remaining dependency is
java.nio.file (FileSystems/Path/PathMatcher glob), a JVM filesystem API kept out
of core.
This commit is contained in:
Yogthos 2026-06-22 18:27:27 -04:00
parent 5c9c5ed6e1
commit 47864403e8
4 changed files with 49 additions and 0 deletions

View file

@ -323,6 +323,10 @@
(condition->message-string obj))
((string=? method-name "toString") (condition->message-string obj))
((string=? method-name "getCause") jolt-nil)
;; java.sql.SQLException chaining — jolt errors don't chain (nil).
((or (string=? method-name "getNextException") (string=? method-name "getCause")) jolt-nil)
((string=? method-name "getStackTrace") (jolt-vector))
((string=? method-name "printStackTrace") jolt-nil)
(else (error #f (string-append "No method " method-name " on Throwable")))))
;; java.lang.Character interop: (.toString \+) -> "+", etc.
((char? obj)