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

Make database backends self-aware #910

Merged
merged 5 commits into from Oct 23, 2019

Conversation

pmatilai
Copy link
Member

Okay okay, maybe not...

Add name and path members to backend db_ops struct, use them for configuring and detecting, and misc related tweaks.

Started doing this for implementing rpmdbStat(), but got stuck wondering about the API: my initial version requires an open rpmdb for stat'ing, which limits its usefulness. Perhaps there should be separate calls for an open database and non-open one, just like there's fstat() and stat(). Thoughts?

@pmatilai pmatilai added API API related cleanup labels Oct 21, 2019
Refactor the hand-written separate tests into an array walk now that we can.
No functional changes, except that there's no more special fallback for BDB.
ndb and sqlite have control of their own paths, BDB and LMDB do things
differently and dummydb doesn't have a path at all.
As the dummy backend supports no operations whatsoever, using it as
a fallback if all else fails needs to emit a warning, not debug goo.
rpmdbStat() can be used without an open rpmdb handle similar to stat()
and rpmdbFStat() takes an open rpmdb handle, akin fstat().

The rationale for these calls is to give API users a backend-independent
way of obtaining data about the database's existence, timestamps etc.
@pmatilai
Copy link
Member Author

Rebased and added both rpmdbStat() and rpmdbFStat() now.

@cgwalters
Copy link
Contributor

Make database backends self-aware

😰

@pmatilai pmatilai merged commit d05ea15 into rpm-software-management:master Oct 23, 2019
@pmatilai pmatilai deleted the dbstat-pr branch October 23, 2019 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API related cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants