Navigation Menu

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

Bug in dbConnect (I think) #118

Closed
bborgesr opened this issue Jun 22, 2016 · 1 comment
Closed

Bug in dbConnect (I think) #118

bborgesr opened this issue Jun 22, 2016 · 1 comment
Labels
Milestone

Comments

@bborgesr
Copy link
Contributor

bborgesr commented Jun 22, 2016

I came across this issue today, as I was trying to make sure all the different ways of specifying drv in a call to dbConnect were also supported in the pool package (in the dbPool function).

So, in the dbConnect documentation, you have (itemized for ease of referencing here):

drv

  1. an object that inherits from DBIDriver, or
  2. a character string specifying the name of DBMS driver, e.g., "RSQLite", "RMySQL", "RPostgreSQL", or
  3. an existing DBIConnection object (in order to clone an existing connection).

Numbers 1 and 3 work. Number 2 didn't:

conn <- DBI::dbConnect(drv = "RSQLite", "CollegeScorecard.sqlite")
 #> Error: Couldn't find driver RSQLite. Looked in:
 #> * global namespace
 #> * in package called RSQLite
 #> * in package called RRSQLite

conn3 <- DBI::dbConnect(drv = "SQLite", "CollegeScorecard.sqlite")
 #> Error in as.integer(from) : 
 #>  cannot coerce type 'S4' to vector of type 'integer'

It's easy to fix this in the pool package, but maybe I shouldn't do that if you either fix it in DBI or maybe just change the documentation to not allow option 2.

PS: Also if you do want to fix and keep option 2, the user should specify the driver (e.g. "SQLite"), rather than the package (e.g. "RSQLite"), right? You'd need to update the documentation...

@krlmlr
Copy link
Member

krlmlr commented Jun 22, 2016

I think that option 2 is deprecated, and the documentation is wrong here.

@krlmlr krlmlr modified the milestone: 0.5 Jul 6, 2016
@krlmlr krlmlr modified the milestones: 0.6, 0.5 Jul 31, 2016
@krlmlr krlmlr closed this as completed in 3439643 Jul 31, 2016
krlmlr pushed a commit that referenced this issue Jul 31, 2016
- Remove misleading parts in `dbConnect()` documentation (#118).
- Use `contains` argument instead of `representation()` to denote base classes (#93).
- `dbDataType()` maps `character` values to `"TEXT"` by default (#102).
- Remove misleading link in `dbDataType()` documentation.
krlmlr added a commit that referenced this issue Aug 11, 2016
- Interface changes
    - `dbDataType()` maps `character` values to `"TEXT"` by default (#102).
    - The default implementation of `dbQuoteString()` doesn't call `encodeString()` anymore: Neither SQLite nor Postgres understand e.g. `\n` in a string literal, and all of SQLite, Postgres, and MySQL accept an embedded newline (#121).

- Interface enhancements
    - New `dbSendStatement()` generic, forwards to `dbSendQuery()` by default (#20, #132).
    - New `dbExecute()`, calls `dbSendStatement()` by default (#109, @bborgesr).
    - New `dbWithTransaction()` that calls `dbBegin()` and `dbCommit()`, and `dbRollback()` on failure (#110, @bborgesr).
    - New `dbBreak()` function which allows aborting from within `dbWithTransaction()` (#115, #133).
    - Export `dbFetch()` and `dbQuoteString()` methods.

- Documentation improvements:
    - One example per function (except functions scheduled for deprecation) (#67).
    - Consistent layout and identifier naming.
    - Better documentation of generics by adding links to the class and related generics in the "See also" section under "Other DBI... generics" (#130). S4 documentation is directed to a hidden page to unclutter documentation index (#59).
    - Fix two minor vignette typos (#124, @mdsumner).
    - Add package documentation.
    - Remove misleading parts in `dbConnect()` documentation (#118).
    - Remove misleading link in `dbDataType()` documentation.
    - Remove full stop from documentation titles.
    - New help topic "DBIspec" that contains the full DBI specification (currently work in progress) (#129).
    - HTML documentation generated by `staticdocs` is now uploaded to http://rstats-db.github.io/DBI for each build of the "production" branch (#131).
    - Further minor changes and fixes.

- Internal
    - Use `contains` argument instead of `representation()` to denote base classes (#93).
    - Remove redundant declaration of transaction methods (#110, @bborgesr).
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants