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

Errors in params list are 0-indexed #89

Closed
coolbutuseless opened this issue Apr 20, 2015 · 2 comments
Closed

Errors in params list are 0-indexed #89

coolbutuseless opened this issue Apr 20, 2015 · 2 comments
Milestone

Comments

@coolbutuseless
Copy link

When a params list to a db query has an error, RSQLite reports the parameter position as a 0-indexed value rather than a 1-indexed value.

e.g. the following code has an error in the second params value, but error is reported as being in "Parameter 1".

library(DBI)
library(RSQLite)

sqlite_file <- 'test.db'
unlink(sqlite_file)
con <- dbConnect(RSQLite::SQLite(), sqlite_file)

dbGetQuery(
    con, "CREATE TABLE records(x REAL, y REAL);"
)


# The following results in:
#   - Error: Parameter 1 does not have length 1.
#
dbGetQuery(
    con,
    "INSERT INTO records (x, y) VALUES (:x, :y)",
    params = list(x = 1, y = list(1,2))
)

dbDisconnect(con)
@krlmlr
Copy link
Member

krlmlr commented Oct 27, 2015

Thanks, confirmed.

@krlmlr krlmlr modified the milestone: 2.0 Nov 10, 2015
@hadley hadley modified the milestones: 2.0, 1.1 Mar 16, 2016
@krlmlr krlmlr closed this as completed in b8eec55 May 25, 2016
krlmlr pushed a commit that referenced this issue Jun 8, 2016
- Fix one-off glitch in error message issued by `dbBind()`.
- Release opened result set if binding fails in `dbSendQuery()` (#89).
- Use `"file::memory:"` instead of `":memory:"` for memory-only databases, the latter doesn't seem to work well on Windows for unknown reasons.
- Enable AppVeyor testing.
- Strip space at end of line in all source files.
- Use new `sqlRownamesToColumn()` and `sqlColumnToRownames()` (r-dbi/DBI#91).
- Use container-based builds on Travis.
- Remove old documentation (#121).
troels pushed a commit to troels/RSQLite that referenced this issue Nov 27, 2019
Handle string quoting and missing values in strings
troels pushed a commit to troels/RSQLite that referenced this issue Nov 27, 2019
- Update Rcpp registration code.
- `dbConnect()` now accepts arbitrary connection parameters in the `...` argument (r-dbi#83, @thrasibule).
- Handles NA values by converting them to NULL (r-dbi#82, @thrasibule).
- Handle string quoting and missing values in strings (r-dbi#89, @jimhester).
- `PKG_CFLAGS` and `PKG_LIBS` are now being set when using pg_config for `includedir` and `libdir` (r-dbi#119, @Usman-R).
- Use `BYTEA` instead of `BLOB` for PostgreSQL 9.5 support.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 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

No branches or pull requests

3 participants