microsoft / dbt-synapse

dbt adapter for Azure Synapse Dedicated SQL Pools
https://dbt-msft.github.io/dbt-msft-docs/docs/dbt-synapse/overview
MIT License
69 stars 30 forks source link

auto-dispatch to dbt-sqlserver? #53

Closed dataders closed 3 years ago

dataders commented 3 years ago

v0.20.0 removes the need for this repeated dispatching... right @jtcohen6? I could be overgeneralizing the macro dispatch changes to also include adapter-level dispatch changes. My understanding is that we wouldn't need the below anymore.

https://github.com/dbt-msft/dbt-synapse/blob/2004b7da6560fbe381b020680988f91c137b6029/dbt/include/synapse/macros/adapters.sql#L1-L3

jtcohen6 commented 3 years ago

Correct! Among other changes to dispatch, we're now including parent adapters in the search order. So dbt will look for:

  1. synapse__information_schema_name
  2. sqlserver__information_schema_name
  3. default__information_schema_name

Where previously it only looked for:

  1. synapse__information_schema_name
  2. default__information_schema_name
dataders commented 3 years ago

@jtcohen6 is there anything needed in this repo to specify that dbt-synapse inheirits from dbt-sqlsever? Or, will dbt-core do this automatically based on the Python class inheritance?

jtcohen6 commented 3 years ago

Or, will dbt-core do this automatically based on the Python class inheritance?

This! Here's where the magic happens:

https://github.com/dbt-msft/dbt-synapse/blob/2004b7da6560fbe381b020680988f91c137b6029/dbt/adapters/synapse/__init__.py#L9-L14