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

question: how to programmatically get a list of supported databases? #103

Open
atn38 opened this issue Mar 24, 2022 · 4 comments
Open

question: how to programmatically get a list of supported databases? #103

atn38 opened this issue Mar 24, 2022 · 4 comments

Comments

@atn38
Copy link

atn38 commented Mar 24, 2022

Hullo,

My apologies if it's obvious, I didn't find a solution from quickly scanning the docs. My use case: programmatically check a list of providers against what taxadb supports so the downstream code can proceed appropriately.

@cboettig
Copy link
Member

Sorry, it's a good question; databases are a moving target and so the static docs haven't really kept up.

Currently the best thing is to consult the internal 'provenance' table, e.g. via:

prov <- taxadb:::parse_prov()
prov

That gives a data.frame of all the database tables taxadb knows about, by version. It's perhaps not super clean but should at least be good for programmatic use.

@atn38
Copy link
Author

atn38 commented Mar 24, 2022

Thanks @cboettig. Looks like the quick and easy way to proceed for my case is to hardcode in the list.

@cboettig
Copy link
Member

I still suggest you use the prov table, as you can see it is a moving target and you are better off being precise about which year of the database you are interested in, and if you intend to fall back on to earlier years if/when a given provider is not available. but of course it is up to you.

@atn38
Copy link
Author

atn38 commented Mar 24, 2022 via email

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