Skip to content

Dart modular_api_sqlserver hard-depends on dart_odbc, breaking the contracts-only stance #24

Description

@ccisnedev

Problem

modular_api_sqlserver (Dart) declares a hard runtime dependency on a driver, breaking the contracts-only stance that the other 5 db packages keep:

  • code/dart/modular_api_sqlserver/pubspec.yaml:13 -> dart_odbc: ^6.2.0
  • Used only by code/dart/modular_api_sqlserver/lib/src/sql_server_metadata_reader.dart (SqlServerMetadataReader, GraphQL Stage-1 schema introspection).

By contrast, TS and Python keep the equivalent SqlServerMetadataReader in the core and load the driver lazily (require('mssql') / dynamic import pyodbc), so their package manifests declare no driver and stay contracts-only. Dart cannot do lazy package loading (static imports, dep must be in pubspec), so the driver leaks into the manifest and every consumer of modular_api_sqlserver pulls dart_odbc even if they only want the DbClient contracts.

Fix direction (per the contracts-only vision, ADR-0004)

Remove the driver from the package — do NOT wrap it in a new satellite package (that adds packages and perpetuates the driver, the opposite of the goal). The metadata reader that needs a driver becomes the user's responsibility (like the db adapter), or ships as an example in docs. modular_api_sqlserver (and, longer term, a unified modular_api_sql) stays pure contracts.

Notes

  • Breaking in Dart (the exported SqlServerMetadataReader symbol / import path goes away). No Dart consumers in production today.
  • Minor related asymmetry to note: Dart modular_api_postgres has no metadata reader at all.
  • Dedicated iteration — not to be mixed with feature work. Aligns with the longer-term goal of converging the 6 db packages into a single modular_api_sql per SDK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions