Skip to content

Conversation

egan8888
Copy link
Contributor

@egan8888 egan8888 commented Jul 14, 2025

Adds support for aliases when generating the query.

Previously column names would be generated as {dataSourceName}__{columnName}. Now, if alias field is provided in schema, that will be used instead. If alias is not provided, we fall back on the original format.

Query generation with resolution is also updated to make use of aliases.

  • For unresolved columns, column names used to be of the form __base_query__{dataSourceName}__{columnName}. Now the column name will be the alias if provided else {dataSourceName}__{columnName}

  • For resolved columns, column names used to be of the form {dataSourceName}__{columnName}__{resolvedColumnName. Now it will be of the form {columnNameAlias} - {resolvedColumnNameAlias} if the relevant aliases are provided, else {dataSourceName}__{columnName} - {resolvedColumnName}.

Included tests for all changes.

This PR also includes some formatting changes from the auto-formatter.

https://app.devrev.ai/devrev/works/ISS-191518

@egan8888 egan8888 changed the title Eric/alias support aliases Jul 14, 2025
@egan8888 egan8888 marked this pull request as ready for review July 14, 2025 20:10
Copy link
Contributor

@zaidjan-devrev zaidjan-devrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try avoiding the alias Record<string, string> prop everywhere. Would it be possible to populate the alias from the tableSchema or other metadata that is present in these functions. If the metadata is not introduced, can we add a prop for that?

@egan8888 egan8888 requested a review from zaidjan-devrev July 15, 2025 17:04
@egan8888 egan8888 requested a review from zaidjan-devrev July 21, 2025 05:56
@egan8888 egan8888 merged commit d724e27 into main Jul 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants