Skip to content

Support Microsoft Fabric / Synapse warehouses and Entra ID access tokens - #1432

Open
lucaspearson wants to merge 2 commits into
rails-sqlserver:mainfrom
Faethm-ai:entra-access-token-fabric-upstream
Open

lucaspearson wants to merge 2 commits into
rails-sqlserver:mainfrom
Faethm-ai:entra-access-token-fabric-upstream

Conversation

@lucaspearson

@lucaspearson lucaspearson commented Dec 2, 2026 •

Copy link
Copy Markdown

Lets the adapter connect to Azure Synapse dedicated SQL pools and Microsoft Fabric Warehouse, including with Microsoft Entra ID access tokens. Refs #1011.

Changes

  • TDS 7.4 with an access token: default tds_version to 7.4 when an access_token is configured. TinyTDS federated authentication needs 7.4, and the 7.3 default silently disabled it. An explicit tds_version still wins.
  • No WITH (NOLOCK) on warehouses: add sqlserver_data_warehouse? (true when @@VERSION reports "Microsoft Azure SQL Data Warehouse", as Synapse and Fabric do). Skip the WITH (NOLOCK) hint in the INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.VIEWS queries there, since warehouses reject table hints ("Table hint NOLOCK is not allowed"), which broke column and view introspection.
  • CHANGELOG entries.

The @@LANGUAGE date format change from #1341, which Fabric also needs, is already on main.

Depends on: access_token reaches TinyTDS through the existing config pass-through. TinyTDS support is in rails-sqlserver/tiny_tds#616; without it the option has no effect.

Testing:

  • New adapter tests for the tds_version defaults (with, without, and explicit) and for warehouse detection and the NOLOCK-free schema SQL, using stubs so they run on SQL Server in CI.
  • The same change, backported to 6.1, runs against Microsoft Fabric Warehouse with an access token: connect, count, where/order/limit, group/count, date grouping, find_by_sql with binds, inserts and pooled reconnects. On main it's covered by the tests above; I haven't run main itself against Fabric.

🤖 Generated with Claude Code

lucaspearson and others added 2 commits December 1, 2026 11:18
- Default tds_version to 7.4 when an access_token is configured.
  Microsoft Entra ID federated authentication (TinyTDS :access_token)
  needs TDS 7.4, and the 7.3 default silently disabled it.
- Skip the WITH (NOLOCK) table hint in the INFORMATION_SCHEMA queries
  when connected to a data warehouse. Azure Synapse dedicated SQL pools
  and Microsoft Fabric Warehouse report "Microsoft Azure SQL Data
  Warehouse" and reject table hints ("Table hint NOLOCK is not
  allowed"), which broke column and view introspection.

Tested against a Microsoft Fabric Warehouse with a TinyTDS
:access_token: connect, count, where/order/limit, group/count, date
grouping, find_by_sql with binds, inserts and pooled reconnects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant