Open 0ctanium opened 2 years ago
To implement this feature the easiest way is to transform the full column path into its name just before sending the response to client. We also need to take in account the case where two columns have ambigus names. We should throw an error. And then advise the user to use aliases. (like the default behavior of pgsql)
But when returning columns to the end user, we can allow two columns with the same name (like the default behavior of pgsql). And use aliases to differentiate them
What would you like to be added or enhanced When querying ImmuDB, it return the full column path ( "([database].[table].[column])" ) instead of the column name ( "[column]" ). It would be useful, when returning response to transform column path, used for internal processing just the column name to allow end user to process the data correctly.
Ex: query response in pgsql cli![image](https://user-images.githubusercontent.com/36778771/140726900-5280affc-a2ed-4d97-bcd2-ef91c5655551.png)
Why is this needed When using some packages, in order to parse raw row data into clear objects, the driver need to get column names. For example, when scanning a response using
database/sql
withsqlx
in go. The package will look for the column name. But it wont be able to find anything because it can't parse the full column path. So sqlx returns an error saying it can't find the column name "missing destination name (dbinstance.transactions.transaction_id) in *model.Transaction"Additional context We started discussing this issue on discord. So if you want te read beginning of that conversation, here is the link: https://discord.com/channels/831257098368319569/831258571664130068/905107567313842246