-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Delete database API #12765
Delete database API #12765
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12765 +/- ##
=============================================
- Coverage 61.75% 34.92% -26.84%
+ Complexity 207 6 -201
=============================================
Files 2436 2386 -50
Lines 133233 131078 -2155
Branches 20636 20268 -368
=============================================
- Hits 82274 45775 -36499
- Misses 44911 82004 +37093
+ Partials 6048 3299 -2749
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
} catch (Exception e) { | ||
if (isSchemaDeleted) { | ||
LOGGER.error("Failed to delete table {}", table); | ||
} else { | ||
LOGGER.error("Failed to delete table and schema for {}", table); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the result should contain the list the tables and schemas that were not deleted and ideally a short message indicating why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Will add that info to the response payload.
@ApiParam(value = "Run in dryRun mode initially to know the list of tables that will be deleted in actual run. " | ||
+ "No tables will be deleted when dryRun=true", required = true) | ||
@QueryParam("dryRun") boolean dryRun) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define the default value to be true
? It would be great if by default it is dryRun
so the UI will mark it by default and users would need to actively turn it off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, made the change 👍
Description
API to delete the given database which effectively deletes all the tables under the given database.
The API has a sync behaviour which means partial database deletion is possible in case of failures.
Server side failures are handled silently and further table deletion is resumed. The response will have appropriate information regarding the tables that failed to delete.
Endpoint :
/databases/<databaseName>
Query param :
dryRun
, required =true
Method :
DELETE
Sample output :
As the API is of idempotent nature client can repeatedly call the API in-case there are tables with failed deletion
labels
feature
release-notes
release-notes
API to delete database and all its underlying tables