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

Clarification on dbConnect() documentation #877

Open
asadow opened this issue May 13, 2024 · 4 comments
Open

Clarification on dbConnect() documentation #877

asadow opened this issue May 13, 2024 · 4 comments

Comments

@asadow
Copy link

asadow commented May 13, 2024

I found arguments like Authentication through SO, but I'm wondering how to find these organically through documentation.

Under the dbConnect() documentation it writes:

... authentication arguments needed by the DBMS instance; these typically include user, password, host, port, dbname, etc. For details see the appropriate DBIDriver.

My question is, where do we "see the appropriate DBIDriver"?

@krlmlr
Copy link
Member

krlmlr commented May 20, 2024

Thanks, Adam. Is the "Methods in other packages" section in https://dbi.r-dbi.org/reference/dbConnect.html helpful? Do we need to rephrase?

@asadow
Copy link
Author

asadow commented Jan 2, 2025

Thanks, Kirill. I'm not sure; I may be missing something. How would I navigate that page toward finding the authentication argument (for the below example)?

conn <- DBI::dbConnect(
  odbc::odbc(),
  driver = "ODBC Driver 17 for SQL Server",
  database = "Standard",
  server = "some-analytics-ondemand.sql.azuresynapse.net",
  authentication = "ActiveDirectoryPassword",
  uid = "[email protected]",
  pwd = keyring::key_get("aad-pass")
)

@krlmlr
Copy link
Member

krlmlr commented Jan 2, 2025

Tough call. There are two steps.

  1. Find the correct method, in this case, odbc::dbConnect("OdbcDriver") . Is this clear enough, or does this need reformatting?
  2. Find the argument in https://odbc.r-dbi.org/reference/dbConnect-OdbcDriver-method.html . Unfortunately, it maps to the ... argument for the OdbcDriver method . If we fix, we need to fix there.

The odbc page has

Connection string keywords are driver-dependent

as the best clue, perhaps this needs to move or be copied closer to the top?

@asadow
Copy link
Author

asadow commented Jan 2, 2025

On 1., no that's clear enough (apart from MySQL vs. SQL Server confusing everyone :))

On 2., I think the only thing is that it's not clear, if one is naive, where to go looking for these keywords. I see there are some resources under "Learn More".

It's tough for me to make any suggestions. Maybe this is a duct-taping challenge. The error without the authentication argument is vague:

Error in `DBI::dbConnect()`:
! ODBC failed with error HY000 from [Microsoft][ODBC Driver 17 for SQL Server][SQL Server].
✖ Cannot open server "somewhere.com" requested by the login.  The login failed.
ℹ From nanodbc/nanodbc.cpp:1150.
Run `rlang::last_trace()` to see where the error occurred.

@krlmlr krlmlr transferred this issue from r-dbi/DBI Jan 3, 2025
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

2 participants