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

feat!: dbListObjects() only allows Id() objects as prefix argument #390

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

dpprdan
Copy link
Contributor

@dpprdan dpprdan commented Jan 29, 2022

This is an attempt to only allow Id() objects as prefix argument to dbListObjects() as mentioned in #372 (comment).

It looks to me like dbListObjects() should always be called with an Id(), never with a SQL()

prefix can now be a list with multiple Id objects, so querying all tables in all schemata a user has access to like this works:

con <- postgresDefault()
tbl <- dbListObjects(con)$table
head(dbListObjects(con, tbl))
dbDisconnect(con)

I am not sure, though, whether this was the intent for using vlapply() and vcapply() here previously or whether I am missing good reasons against making prefix in dbListObjects() vectorised?

Wouldn't it be cleaner though, to only have an Id method (and one for MISSING) for dbListObjects() instead of an ANY one? But that would require those changes be made to DBI (and other DBI-related packages), as well. I am probably missing something there as well.

@dpprdan dpprdan changed the title dbListObjects(): allow Id() objects only as prefix dbListObjects(): only allow Id() objects as prefix Nov 24, 2022
@krlmlr
Copy link
Member

krlmlr commented Dec 5, 2022

Re-triggered failing job.

@krlmlr krlmlr changed the title dbListObjects(): only allow Id() objects as prefix feat!: dbListObjects() only allows Id() objects as prefix argument Mar 16, 2023
@krlmlr krlmlr merged commit 3b1f160 into r-dbi:main Mar 16, 2023
@krlmlr
Copy link
Member

krlmlr commented Mar 16, 2023

Thanks!

@dpprdan dpprdan deleted the fix/dbListObjects_prefix_Id_only branch March 16, 2023 08:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants