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

dbExecute #109

Merged
merged 10 commits into from Jun 8, 2016
Merged

dbExecute #109

merged 10 commits into from Jun 8, 2016

Conversation

bborgesr
Copy link
Contributor

@bborgesr bborgesr commented Jun 6, 2016

Moving the relevant code for the dbExecute() function to this PR, originally in #108

@codecov-io
Copy link

codecov-io commented Jun 6, 2016

Current coverage is 46.25%

Merging #109 into master will decrease coverage by 0.44%

@@             master       #109   diff @@
==========================================
  Files            15         15          
  Lines           409        413     +4   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits            191        191          
- Misses          218        222     +4   
  Partials          0          0          

Powered by Codecov. Last updated by a79dcc6...c9d6332

#' \code{SELECT} query on table (ex: \code{UPDATE}, \code{DELETE},
#' \code{INSERT INTO}, \code{DROP TABLE}, ...). It will execute
#' the query and return the number of rows affected by the operation.
#' (If the return value is 0 or -1, you're using it wrong.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems a bit strong as you might be using it to set sql options, which don't affect any rows.

@hadley
Copy link
Member

hadley commented Jun 6, 2016

Apart from small doc comment, LGTM.

function(conn, statement, ...) {
rs <- dbSendQuery(conn, statement, ...)
on.exit(dbClearResult(rs))
dbGetRowsAffected(rs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fix the return type here (numeric, to support >= 2³¹ rows)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's reasonable to do that in the docs - I'm not sure if using valueClass is good practice. It adds a relatively expensive post-hoc check.

@krlmlr krlmlr merged commit 148b08e into r-dbi:master Jun 8, 2016
@krlmlr
Copy link
Member

krlmlr commented Jun 8, 2016

Thanks!

krlmlr pushed a commit that referenced this pull request Jun 10, 2016
- Remove redundant declaration of transaction methods (#110, @@bborgesr).
- New `dbExecute()`, forwards to `dbSendQuery()` by default (#109, @bborgesr).
krlmlr added a commit that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants