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

Default implementation for dbDataType() #70

Closed
krlmlr opened this issue Dec 23, 2015 · 1 comment · Fixed by #97
Closed

Default implementation for dbDataType() #70

krlmlr opened this issue Dec 23, 2015 · 1 comment · Fixed by #97
Milestone

Comments

@krlmlr
Copy link
Member

krlmlr commented Dec 23, 2015

@krlmlr krlmlr added this to the 0.3.2 milestone Mar 30, 2016
krlmlr added a commit that referenced this issue Apr 30, 2016
- The default implementation for `dbDataType()` (powered by `dbiDataType()`) now also supports `difftime` and `AsIs` objects and lists of `raw` (#70).
- The `ANSI` dummy driver does not provide its own implementation of `dbDataType()` anymore, this removes the necessity to update many downstream packages.
krlmlr pushed a commit that referenced this issue Apr 30, 2016
- The default implementation for `dbDataType()` (powered by `dbiDataType()`) now also supports `difftime` and `AsIs` objects and lists of `raw` (#70).
- The `ANSI` dummy driver does not provide its own implementation of `dbDataType()` anymore, this removes the necessity to update many downstream packages.
- Fix CRAN check.
- Fix inteface for `sqlCreateTable()`.
krlmlr pushed a commit that referenced this issue May 2, 2016
* New package maintainer: Kirill Müller.

* `dbGetInfo()` gains a default method that extracts the information from
  `dbGetStatement()`, `dbGetRowsAffected()`, `dbHasCompleted()`, and
  `dbGetRowCount()`. This means that most drivers should no longer need to
  implement `dbGetInfo()` (which may be deprecated anyway at some point) (#55).

* `dbDataType()` and `dbQuoteString()` are now properly exported.

* The default implementation for `dbDataType()` (powered by `dbiDataType()`) now
  also supports `difftime` and `AsIs` objects and lists of `raw` (#70).

* Default `dbGetQuery()` method now always calls `dbFetch()`, in a `tryCatch()`
  block.

* New generic `dbBind()` for binding values to a parameterised query.

* DBI gains a number of SQL generation functions. These make it easier to
  write backends by implementing common operations that are slightly
  tricky to do absolutely correctly.

    * `sqlCreateTable()` and `sqlAppendTable()` create tables from a data
      frame and insert rows into an existing table. These will power most
      implementations of `dbWriteTable()`. `sqlAppendTable()` is useful
      for databases that support parameterised queries.

    * `sqlRownamesToColumn()` and `sqlColumnToRownames()` provide a standard
      way of translating row names to and from the database.

    * `sqlInterpolate()` and `sqlParseVariables()` allows databases without
      native parameterised queries to use parameterised queries to avoid
      SQL injection attacks.

    * `sqlData()` is a new generic that converts a data frame into a data
      frame suitable for sending to the database. This is used to (e.g.)
      ensure all character vectors are encoded as UTF-8, or to convert
      R varible types (like factor) to types supported by the database.

    * The `sqlParseVariablesImpl()` is now implemented purely in R, with full
      test coverage (#83, @hannesmuehleisen).

* `dbiCheckCompliance()` has been removed, the functionality is now available
  in the `DBItest` package (#80).

* Added default `show()` methods for driver, connection and results.

* New concrete `ANSIConnection` class and `ANSI()` function to generate a dummy
  ANSI compliant connection useful for testing.

* Default `dbQuoteString()` and `dbQuoteIdentifer()` methods now use
  `encodeString()` so that special characters like `\n` are correctly escaped.
  `dbQuoteString()` converts `NA` to (unquoted) NULL.

* The initial DBI proposal and DBI version 1 specification are now included as
  a vignette. These are there mostly for historical interest.

* The new `DBItest` package is described in the vignette.

* Deprecated `print.list.pairs()`.

* Removed unused `dbi_dep()`.
@imanuelcostigan
Copy link

Default implementation fails DBItest for AsIs Date and DateTime. Not sure whether this is an issue for

dbDataType(ANSI(), I(Sys.Date()))
#> [1] "DOUBLE"

Maybe something like this in as_is_data_type()?

dd <- I(Sys.Date())
class(dd) <- class(dd)[-1]

@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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants