Hey all, can Secoda connect to the dbt semantic la...
# secoda-support
q
Hey all, can Secoda connect to the dbt semantic layer so I can develop queries not only to SQL datbases? https://thedataleap.slack.com/archives/C01PLVBE334/p1756727157552719
a
Hey @quick-house-6813 Thanks for reaching out regarding this. Do you have a semantic model in dbt? What are you trying to achieve?
q
We do. And we define metrics in the dbt Semantic Layer as welll.. .. So when I try documenting the metrics in Secoda, I want to use the Semantic layer to add a basic query in the document in this fashion
Copy code
select *
from 
    {{ semantic_layer.query(
    metrics = ['total_events'],
    group_by = [
        TimeDimension('metric_time', 'day'),
        Dimension('event_type__event_type_name'),
        Dimension('template__template_name')
    ]
) }}
instead of plain SQL like this...
Copy code
SELECT
    DATE_TRUNC('day', event_time) AS metric_time,
    event_type.event_type_name,
    template.template_name,
    COUNT(*) AS total_events
FROM
    events_table AS events
JOIN
    event_type_table AS event_type ON events.event_type_id = event_type.id
JOIN
    template_table AS template ON events.template_id = template.id
GROUP BY
    1, 2, 3
ORDER BY
    1, 2, 3;
e.g, HEX Technologies allow configuring an specific semantic-layer cnx to query this way, as well as using it with an specifc component. I do not need such component but the ability to query the semantic layer rather than the physical table https://hex.tech/blog/dbt-semantic-layer-integration/
If you long term plan to integrate dbt semantic layer as another integration, that would be awsome, really
This links to my long lasting claim about having metrics as first class citizen in Secoda 😄
a
Thanks for sharing all these details and the examples @quick-house-6813. We've relayed your feedback to our Product team and we'll keep you posted if there are any updates on this front! Let us know if you have any questions or if you need anything else. 🙂