Skip to content

Forcing virtual layer models to be tables (not views) #5069

@rm-shanebreeze

Description

@rm-shanebreeze

Is there any plans to have an option to force a model in the virtual layer to be a table rather than a view?

I understand this is a bit of a divergence from sqlmesh's virtual layer abstraction. However, I have a use case where I want external tools (dataflow in this case) to interact with the models generated by sqlmesh. But the external tool can only interact with a table, not a view.

My current workaround is to have post-hook SQL in the model my_model:

drop table if exists my_model_physical;
create table my_model_physical as
select *
from my_model;

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureAdds new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions