-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: endpoint to rename an attribute name in a table #178
base: master
Are you sure you want to change the base?
Conversation
Another option is to have SQL transactions for renaming attributes. The python sqlite3 library doesn't seem to support transactions by default, but I found this: https://stackoverflow.com/a/23634805/10047268 |
Thank you @YashKandalkar, will take a look |
@Namyalg — Any updates on this? It would be good to resolve the merge conflicts as well. |
This is not yet resolved |
@Namyalg - do you have time to finish this PR? If not, let's file an issue and try to attract other contributions to finish the featureset. |
I will work on resolving the issue. |
Pull Request Template
Description
This PR adds an endpoint to rename/modify the attribute name of a table
Fixes #177
Type of change
How Has This Been Tested?
The functionality of the endpoint has been tested locally
Working
The endpoint is a
POST
request that takes in the payload as :Using cURL, it can be performed as :
turnover_parameter
, title of simulation asrun4
turnover_parameter
has the attributes (can be obtained using the endpoint/upload/db/tables
) : ["id","foliage","stems","branch","stem_snag","branch_snag","coarse_root","fine_root","branch_snag_split","coarse_ag_split","fine_ag_split"]To rename the attribute
id
toids
, the cURL command isErroneous cases handled
Assume the name of the table passed is
turn_parameter
instead ofturnover_parameter
, the request will result inAttribute
stems
does not exist inturnover_parameter
Questions
In the current design, encountering an error of the 2 types will immediately return from the endpoint with the {
status
: 0,message
:error-that-occured
} .This implies, that the changes or queries that were present earlier will be executed.
To provide a robust mechanism, a few other ideas are :
What would the best option amongst these ?
@HarshCasper @aornugent @SanjaySinghRajpoot @YashKandalkar I would like to know your opinions