-
Notifications
You must be signed in to change notification settings - Fork 3
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 intermediate tables after use #89
Merged
RasmusSkytte
merged 18 commits into
main
from
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
Feb 8, 2024
Merged
Delete intermediate tables after use #89
RasmusSkytte
merged 18 commits into
main
from
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
Feb 8, 2024
Conversation
This file contains 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
1 task
1 task
marcusmunch
force-pushed
the
main
branch
2 times, most recently
from
January 19, 2024 13:14
17dc692
to
20f4e28
Compare
RasmusSkytte
requested review from
a team,
kaare-gr and
LasseEngboChr
and removed request for
a team,
kaare-gr and
LasseEngboChr
January 19, 2024 13:40
RasmusSkytte
force-pushed
the
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
branch
from
February 1, 2024 10:52
f5de25e
to
4926073
Compare
RasmusSkytte
force-pushed
the
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
branch
from
February 1, 2024 14:09
4926073
to
2ef6de3
Compare
RasmusSkytte
requested review from
a team,
kaare-gr and
LasseEngboChr
and removed request for
a team
February 1, 2024 14:18
RasmusSkytte
changed the title
Delete intermediate tables after use in
Delete intermediate tables after use
Feb 1, 2024
update_snapshot
RasmusSkytte
force-pushed
the
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
branch
from
February 5, 2024 10:59
2ef6de3
to
2b5b8fb
Compare
6 tasks
5 tasks
LasseEngboChr
approved these changes
Feb 8, 2024
RasmusSkytte
deleted the
fix/86-lacking-clean-up-of-temporary-tables-in-update_snapshot
branch
February 8, 2024 10:18
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.
Intent
Fixes #86
Approach
defer_db_cleanup
was added which useswithr::defer
to remove the specified table when the function exits.By inserting this function into our functions when we generate new tables, the intermediate tables created will automatically be removed once the function returns.
EDIT: to clarify, it will delete the table once the parent of
defer_db_cleanup
exits, not whendefer_db_cleanup
exits.A new function
unique_table_name()
is added (inspired by dbplyrs internal function of the same name) which gives an easy way to create table names likeSCDB_###
for tables.By using this function, we can keep track of the tables that we explicitly need and which should be kept when the function returns (which we can give the "SCDB_" prefix) and those we implicitly create in intermediate computations and should not remain after the function returns (which will get the "dbplyr_" prefix).
A new testing helper
connection_clean_up()
is added that is used at the end of tests that use a data base backend.This function looks for the existence of
dbplyr_###
tables and gives a warning if they exists. Then it closes the connection to the data base.Known issues
This PR also contains the code being merged inMove functions to separate files #95Once merged, this PR will be rebased and opened.Checklist
NEWS.md