Skip to content

feat: Add Microsoft SQL Server (MSSQL) connector #204

@danghoangnhan

Description

@danghoangnhan

Context

Pathway currently supports PostgreSQL, MySQL, and other database connectors, but lacks support for Microsoft SQL Server (MSSQL). MSSQL is widely used in enterprise environments and adding native support would expand Pathway's reach for real-time data processing pipelines.

Proposal

Add a new pw.io.mssql module with read() and write() functions for Microsoft SQL Server.

Key features

  • Pure Rust TDS implementation via tiberius crate — no ODBC drivers required, works on any Linux environment without additional system dependencies
  • Read modes:
    • static — polls the table periodically and diffs against stored state to detect inserts, updates, and deletions
    • streaming — uses MSSQL's Change Data Capture (CDC) for real-time change tracking via the transaction log
  • Write modes:
    • stream_of_changes — outputs a log of all data updates with time and diff columns
    • snapshot — maintains current state using atomic MERGE upserts
  • Supported MSSQL versions: SQL Server 2017, 2019, 2022, and Azure SQL Edge
  • ADO.NET-style connection strings consistent with MSSQL ecosystem conventions

Implementation scope

  • Python API: pw.io.mssql.read() and pw.io.mssql.write()
  • Rust connector: full TDS protocol support with connection pooling, type mapping, and batch operations
  • Integration tests: comprehensive test suite (~778 lines) covering static/CDC reads, writes, snapshot mode, schema handling, and error cases
  • Docker Compose example: ready-to-run example with SQL Server container

Types of changes

  • New feature (non-breaking change which adds functionality)

Related work

This follows the same connector patterns established by the existing PostgreSQL (pw.io.postgres) and MySQL connectors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions