dbt-labs / dbt-semantic-interfaces

The shared semantic layer definitions that dbt-core and MetricFlow use.
Apache License 2.0
66 stars 13 forks source link

[Feature] Add cache config to saved query #252

Closed Jstein77 closed 6 months ago

Jstein77 commented 7 months ago

Is this your first time submitting a feature request?

Describe the feature

To enable declarative caching you need to be able to specify if a saved query should be used to populate the cache. Users can set cache: enabled: true | enabled as a configuration of a saved query. The saved query spec is below:

saved_queries:
    - name: my_query
        description:
        query_params:
            ...
        exports:
            ...
                config:
                  cache:
                    enabled: true|false

Describe alternatives you've considered

No response

Who will this benefit?

Users who want to increase the performance of saved queries.

Are you interested in contributing this feature?

No response

Anything else?

No response

graciegoheen commented 7 months ago

@Jstein77 I know we talked about this awhile back, can you remind me the reason we went with adding this as to the config: so it's captured here. I believe it was for parity with the way enabled works for other resource types in core (docs here). Were we also imagining someone might enable the cache for a set of saved queries?

Jstein77 commented 7 months ago

@graciegoheen that's correct!

emmyoop commented 7 months ago

cache is now supported in dbt-core with https://github.com/dbt-labs/dbt-core/pull/9588.