From ad14d0f5c969a7ee1ff3a379fd93f1a396d52228 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 17 Jun 2026 22:22:32 -0400 Subject: [PATCH] jrunner: use bulk copy (-b) for SQL Server destinations Pass jrunner's -b flag when the dest JDBC URL is jdbc:sqlserver:, so SQL Server loads stream via TDS bulk copy instead of 250-row INSERT...VALUES round trips. Non-SQL-Server dests are unchanged. Requires the jrunner -b support (bulk-copy branch). Co-Authored-By: Claude Opus 4.8 --- pipekit/jrunner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipekit/jrunner.py b/pipekit/jrunner.py index 5162eae..d73f9e8 100644 --- a/pipekit/jrunner.py +++ b/pipekit/jrunner.py @@ -171,6 +171,11 @@ def migrate( argv.append("-t") if clear: argv.append("-c") + # SQL Server dest: stream via TDS bulk copy instead of INSERT...VALUES + # round trips (much faster on wide/large tables). jrunner -b is a no-op + # for non-SQL-Server dests, but only pass it where it applies. + if (dest_conn.get("jdbc_url") or "").lower().startswith("jdbc:sqlserver:"): + argv.append("-b") proc = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, env=_subprocess_env())