Skip to content

std.mssql (D123): deferred until after v0.16.0 — port mssql-rs or link its ODBC driver #2458

Open

Description

@ehartford

Deferred by Eric, 2026-10-18: "we are putting off mssql until after the next release." Recorded in docs/meetings/2026-10-09-D123-mssql-permissive-references-and-std-value-types.md.

Where the direction stood. Source: microsoft/mssql-rs (MIT). Measured 2026-10-18: mssql-tds 52k production lines + 67k inline tests (151k total), mssql-odbc 41k production lines; tokio, native-tls, bytes, async-trait, azure_identity/reqwest. Two paths discussed:

  1. Port mssql-tds to With by hand, module by module (io/message → token → datatypes → security → connection → query), its inline test cases as the acceptance matrix. A Rust migrator was judged not worth it (no Rust front end to lean on; the hard parts — tokio, dyn traits, lifetimes — are not mechanical). Weeks, not days.
  2. Link the compiled mssql-odbc C library (it exports the 50 standard ODBC entry points: SQLDriverConnectW, SQLExecDirectW, SQLFetch, SQLGetData, …) behind a std module of hand-written extern fn declarations and ~150 ODBC constants (no c_import in toolchain code), resource types with Drop → SQLFreeHandle, carried as a bundle beside the compiler and linked only into programs that use it. Eric does not want a Rust toolchain in the SDK build; the idea was to sideload the binaries once and pin them.

Open, all Eric's:

  • Port versus link.
  • If linking: where the pinned binaries come from (upstream publishes none — no GitHub releases, not on crates.io); how a TLS security fix reaches a binary pinned "forever"; static archive versus a shipped cdylib; glibc floor 2.28 and macOS minimum for a sideloaded build.
  • OpenSSL versus rustls on Linux (the seed links no host library).
  • Entra ID (Azure AD) login is in scope: the LOGIN7 federated-auth token is in mssql-tds; token acquisition is HTTPS+JSON.
  • The from integration: docs/proposals/from-query-expressions.md dispatches on a hardcoded compiler table (Json, sqlite.Db). A provider trait (the compiler parses and type-checks the SQL; the library renders its dialect at comptime and executes) would let mssql live outside the compiler and still get from.
  • Value types std.decimal (over i128), std.time, std.guid remain prerequisites (D123).

Activity

  1. added this to the post-v0.16.0 milestone on Oct 18, 2026
  2. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced: std.mssql does not exist (deferred by Eric until after v0.16.0, D123).

    $ with check main.w   # use std.mssql
    error: import module not found: 'std.mssql' …
    

    post-release: deferred by ruling.

  3. ehartford commented on Nov 25, 2026

    @ehartford
    ContributorAuthor

    v0.16.0 is out, so the deferral has lapsed and the three open questions in the body are the only thing in the way; they are yours (port mssql-tds by hand versus link the ODBC driver, and if linking, where pinned binaries come from).

    One line of evidence since the deferral: the standard library's rule since D146 is that an engine is a migrated corpus or With code, and the SDK build carries no Rust toolchain. Linking a prebuilt mssql-odbc would be the first standard module whose engine With cannot build from source.

    Prediction: port, module by module, with the inline tests as the acceptance matrix, 70%.

    Labelling human attn needed.

  4. ehartford commented on Nov 25, 2026

    @ehartford
    ContributorAuthor

    Ruled by Eric, 2026-11-25 (answers to briefs.md).

    Port mssql-tds, module by module; start the value types (std.decimal, std.time, std.guid) now. TDS runs its TLS handshake inside its own packets, so the security and connection modules depend on #3134's answer (a migrated TLS engine); message, token and datatype modules do not. Entra ID waits until SQL login works. Label removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions