Skip to content

Feature request: generate sources "update" mode also update staging models (rather than overwrite or leave unchanged) #342

Description

@jaredx435k2d0

Describe the current behavior
If I have a pre-existing some_staging_model.sql as:

SELECT
	col1

FROM
	some_table

WHERE
	col1 = FALSE

, and there is a new column that should be added due to it's being recently-added in the source, generate sources will remove my existing transformations when it updates some_staging_model.sql as:

SELECT
	col1
,	col2

FROM
	some_table

Requested behaviour
I would expect that it would retain the existing SQL, and just add new columns / drop newly-deleted columns

Desktop (please complete the following information):

  • OS: macOS 13.2.1 (22D68)
  • Python 3.10.10
  • dbt-core==1.3.3
  • dbt-coves==1.3.0a29
  • dbt-snowflake==1.3.0

Additional context
Contents of my .dbt_coves.config.yml:

generate:
  sources:
    update_strategy: update

Maybe this should only be the case if the update strategy is set to "update"?

I'm trying to automate my staging layer refresh using dbt-coves. If, however, I'll lose all staging layer transformations every time it's run, then I can't use it for this purpose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreviewed: yesHas undergone reviewtriaged: noHasn't been approved for future implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions