feat: endpoint to rename an attribute name in a table#178
Open
Namyalg wants to merge 10 commits intomoja-global:masterfrom
Open
feat: endpoint to rename an attribute name in a table#178Namyalg wants to merge 10 commits intomoja-global:masterfrom
Namyalg wants to merge 10 commits intomoja-global:masterfrom
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 |
Member
Author
|
Thank you @YashKandalkar, will take a look |
Member
|
@Namyalg — Any updates on this? It would be good to resolve the merge conflicts as well. |
Member
Author
|
This is not yet resolved |
Contributor
|
@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. |
Member
Author
|
I will work on resolving the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
POSTrequest that takes in the payload as :Using cURL, it can be performed as :
turnover_parameter, title of simulation asrun4turnover_parameterhas 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
idtoids, the cURL command isErroneous cases handled
Assume the name of the table passed is
turn_parameterinstead ofturnover_parameter, the request will result inAttribute
stemsdoes not exist inturnover_parameterQuestions
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