Skip to content

clean up relation construction #91

@dataders

Description

@dataders

we should try and standardize on a convention of using {{ relation }} wherever possible over these variants:

  • {{ relation.schema }}.{{ relation.identifier }}
  • to_relation.schema ~ '.' ~ to_relation.identifier

@jtcohen6, how do we disable by default database being included when calling {{ relation }}? Do we have create a child of the Relation class?

EXEC('CREATE SCHEMA {{ relation.without_identifier().schema }}')

create view {{ relation.schema }}.{{ relation.identifier }} as

EXEC sp_rename '{{ from_relation.schema }}.{{ from_relation.identifier }}', '{{ to_relation.identifier }}'

{%- set full_relation = relation.schema ~ '.' ~ relation.identifier -%}

EXEC('create view {{ tmp_relation.schema }}.{{ tmp_relation.identifier }} as
{{ temp_view_sql }}
');

{%- set full_to_relation = to_relation.schema ~ '.' ~ to_relation.identifier -%}
{%- set full_from_relation = from_relation.schema ~ '.' ~ from_relation.identifier -%}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions