Repository navigation
Renaming columns in queries #1728
|
My request is: https://localhost:5001/api/Product?$select=fpartno,frev,fdescript. I would like to rename the columns to more meaningful names. In SQL it was Select PartNo=fpartno, Revision=frev, ... Can I do that with Rest\DAB? |
Answered by
seantleonard
Sep 19, 2023
Replies: 1 comment
|
Hi BumpaRoy, You can add column mappings (aliases) to your database columns to give more friendly names. See https://learn.microsoft.com/azure/data-api-builder/configuration-file#mappings For each entity in your runtime config, you can add a mappings section like so, where the format is "mappings": {
"fpartno": "PartNo",
"frev": "Revision"
}The mappings will apply to both GraphQL and REST endpoints. |
0 replies
Answer selected by
BumpaRoy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi BumpaRoy,
You can add column mappings (aliases) to your database columns to give more friendly names. See https://learn.microsoft.com/azure/data-api-builder/configuration-file#mappings
For each entity in your runtime config, you can add a mappings section like so, where the format is
"db_column_name": "Alias"The mappings will apply to both GraphQL and REST endpoints.