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

Feature Request: Virtual connection #50

Open
mgirlich opened this issue Dec 3, 2021 · 2 comments
Open

Feature Request: Virtual connection #50

mgirlich opened this issue Dec 3, 2021 · 2 comments

Comments

@mgirlich
Copy link

mgirlich commented Dec 3, 2021

For testing purposes it would be great to have something like a "virtual" connection. That is, a connection that can be created without actually connecting to a database. This connection could then be used in functions like DBI::dbQuoteLiteral() that don't need a live connection.
The dbplyr package has something like this with the simulate_*() functions. This can be useful for testing when one cannot connect locally to a specific database.
I also think/hope one could then get rid of some code duplication between dbplyr and the DBI packages, for example quoting literals is also defined in dbplyr.

@krlmlr krlmlr transferred this issue from r-dbi/DBI Dec 17, 2021
@krlmlr
Copy link
Member

krlmlr commented Dec 17, 2021

Thanks for raising this, good idea. For DBI you can create a class that inherits from the correct connection class, if necessary implement a dbSendQuery() method that fails. Providing the mock class would be a job for the backend packages.

@krlmlr
Copy link
Member

krlmlr commented Dec 19, 2021

Does {dittodb} solve this?

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