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

creating a new SQL script from connection forces preview, which could be expensive #3611

Closed
kevinushey opened this issue Oct 5, 2018 · 7 comments
Assignees
Milestone

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Oct 5, 2018

System details

RStudio Edition : Desktop
RStudio Version : v1.2.1029
OS Version      : macOS 10.14
R Version       : 3.5.1

Steps to reproduce the problem

In the Connections pane, click the SQL button and create a new script.

Describe the problem in detail

A new script is created. After accepting the prompt to save the file, the query is run. The default query is e.g.

SELECT * FROM "public"."mtcars"

Describe the behavior you expected

We should avoid running the query as it could be expensive if a very large table is chosen from the database.

@kevinushey kevinushey added this to the v1.2 milestone Oct 5, 2018
@jmcphers
Copy link
Member

jmcphers commented Oct 8, 2018

Worth considering, accidentally opening giant data is a consistent theme! @javierluraschi what do you think?

@kevinushey
Copy link
Contributor Author

Where does the sample query get generated for new SQL documents created through this API? I tried diving in myself but couldn't discover the right place.

@kevinushey
Copy link
Contributor Author

@javierluraschi will you still have some time to tackle this? If not let me know and I'll take a look.

@kevinushey
Copy link
Contributor Author

Thanks @javierluraschi!

@ronblum ronblum self-assigned this Dec 18, 2018
@ronblum
Copy link
Contributor

ronblum commented Feb 19, 2019

I tried this out on both RStudio Server (Red Hat 7.6) and Desktop (MacOS 10.14), with a few databases, and the SQL preview is getting executed as soon as the file is saved

@ronblum ronblum reopened this Feb 19, 2019
@kevinushey
Copy link
Contributor Author

@ronblum did you test with the latest (development) versions of odbc and sparklyr? IIUC the fixes were made in those packages as opposed to RStudio itself.

@ronblum
Copy link
Contributor

ronblum commented Feb 19, 2019

Thank you! Confirmed on several desktop and server installations.

I'm leaving this with the "verifying" tag for now, as a reminder to validate when the updated package is live.

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

No branches or pull requests

4 participants