Skip to content

Releases: dxdc/sqlalchemy-mssql-bulkcopy

Release list

v0.1.0

Choose a tag to compare

@dxdc dxdc released this 06 Apr 23:49
f98632b

Bulk copy for SQLAlchemy + mssql-python — 10-50x faster writes via SQL Server's native TDS bulk load protocol.

API

  • bulkcopy(conn, data, table_name, **kwargs) — direct function, no engine config needed, returns driver result dict
  • register_bulkcopy(engine, **defaults) — SA do_executemany event hook with per-statement opt-in via execution_options(use_bulkcopy=True)
  • bulkcopy_insert_method — pandas method= callable for df.to_sql()

Highlights

  • All cursor.bulkcopy() kwargs pass through to the driver — future-proof when mssql-python adds new options
  • on_complete callback for confirming bulkcopy was used and inspecting throughput
  • Graceful fallback to executemany() with logging on any error
  • Handles DataFrames, tuples, generators, lists-of-lists
  • Column key → DB column name mapping via SA's compilation context

Full Changelog: https://github.com/dxdc/sqlalchemy-mssql-bulkcopy/commits/v0.1.0