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 <noreply@anthropic.com>
This commit is contained in:
Paul Trowbridge 2026-06-17 22:22:32 -04:00
parent 40c00bca7b
commit ad14d0f5c9

View File

@ -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())