Skip to content
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

What determines a changed database? #7

Open
jungle-boogie opened this issue May 9, 2021 · 3 comments
Open

What determines a changed database? #7

jungle-boogie opened this issue May 9, 2021 · 3 comments

Comments

@jungle-boogie
Copy link

Hi,

Problem I want to solve:
Only commit changes when there are real changes.

Issue I see:
It seems simply copying a database results in dio thinking there were changes.

Notice these two databases (in terms of sha has) are identical, but with slightly different names:

$ sha256sum iso8601traffic.db ~/www/LasVegasMetroTraffic.db
f2a5928b53efdb7bba657e08c18e97cf5f669224cc755ebb4f8455ba5cb86312  iso8601traffic.db
f2a5928b53efdb7bba657e08c18e97cf5f669224cc755ebb4f8455ba5cb86312  /home/jungle/www/LasVegasMetroTraffic.db

I have a script that gets data, saves to a csv file, and then attemps to import into the first database, then will copy the database to a different location, with a different name.

The problem is, dio, thinks there's been changes to the latter database, when there are actually no changes at all to the first or second database. This means there were no records added, records deleted, or any modifications at all.

For instance, dio status reported a status change for copying iso8601traffic.db to LasVegasMetroTraffic.db, even though the sha hash didn't change before or after the copy.

As a result, this commit is blank:
https://dbhub.io/diffs/jungle-boogie/LasVegasMetroTraffic.db?commit_a=5c090c0a31cf7c9ec0ff121821062fcd4fdc1c3460621c122a60631b04a533ad&commit_b=705ec0229cab53aa39a597080728369c5fa8e9818c768c861e520086813cfe82

Is there something I can do to have dio status only report on real changes?

@jungle-boogie
Copy link
Author

Sorry, that may not be the most straight forward example or question.

Just do this. Make a copy of your database outside its current directory, then copy that same file back into the original location, keeping the same file name.

Now run dio status. Did it report any changes? In my case dio thought there were changes.

@jungle-boogie
Copy link
Author

jungle-boogie commented Jun 18, 2021

I'm working around this problem by periodically and randomly uploading the database. There's a chance there could be a blank database upload, but it's better than nearly every commit having no changes.

@justinclift
Copy link
Member

Ahhh. We'll probably need to call @MKleusberg's "Diff()" functionality, so it runs that to determine if there have been changes. That should return a "no changes" result when there haven't been any, and return the list of what has, when there have been.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants