Releases: r-dbi/RSQLite
RSQLite 2.2.0
- Avoid mangling column names (#259).
RSQLite 2.1.5
RSQLite 2.1.4
- Replace
std::mem_fn()
byboost::mem_fn()
which works for older compilers.
RSQLite 2.1.3
- Replace
std::mem_fun_ref()
bystd::mem_fn()
.
RSQLite 2.1.2
Bundled library
- Upgrade bundled sqlite version to 3.29.0.
Compatibility fixes
-
Compatibility with new releases of blob and hms.
-
dbUnquoteIdentifier()
also handles unquoted identifiers of the formtable
orschema.table
, for compatibility with dbplyr.
Bug fixes
-
Fix query for listing tables in schema (#279).
-
Coercing
NULL
values tointeger64
andnumeric
now works in corner cases (#291). -
dbExistsTable()
works in corner cases where the table name contains backticks (#275). -
Error messages are encoded in UTF-8.
-
Column names are marked as UTF-8 on return, to fix encoding problems on Windows (#276, @shrektan).
-
Fix segmentation fault when an open connection is garbage-collected with
options(warn = 2)
(#245).
New features
Internal
-
Load extensions through API call, to support repeated loading.
-
Align
DbResult
and other classes with RPostgres and RMariaDB. -
Tested with R >= 3.2 only (but not declared).
-
Use
default_skip
. -
Improve warning when
dbGetQuery()
is called with a statement (#226). -
Add test for correct use of non-UTF8-encoded column names (#277, @wush978).
-
Avoid including the call in errors.
RSQLite 2.1.0
Bug fixes
- Fix rchk warnings on CRAN (#250).
dbRowsAffected()
anddbExecute()
return zero after aDROP TABLE
statement, and not the number of rows affected by the lastINSERT
,UPDATE
, orDELETE
(#238).dbIsValid()
returnsFALSE
instead of throwing an error for an invalid connection object (#217).- Names in the
x
argument todbQuoteIdentifier()
are preserved in the output (r-lib/DBI#173). - Ignore invalid UTF-8 strings in
dbQuoteIdentifier()
(r-dbi/DBItest#156).
Features
- Update bundled sqlite3 library to 3.22 (#252).
- Values of class
"integer64"
are now supported fordbWriteTable()
anddbBind()
(#243). - New connections now automatically load default RSQLite extensions (#236).
- Implement
dbUnquoteIdentifier()
.
Internal
- Now raising error if
dbBind()
is called with too many named arguments, according to spec. - Refactor connection and result handling to be more similar to other backends.
v2.0
API changes
- Updated embedded SQLite to 3.19.3.
- 64-bit integers are returned as
integer64
vectors. Thebit64
package is imported to support this data type (#65). - The
row.names
argument todbFetch()
,dbReadTable()
,
dbWriteTable()
,sqliteBuildTableDefinition()
, andsqlData()
now
defaults toFALSE
. The old default can be restored temporarily on a
per-package basis by calling
pkgconfig::set_config("RSQLite::row.names.query" = NA)
.NULL
is a
valid value for therow.names
argument, same asFALSE
(#210). - The
name
argument todbBegin()
,dbCommit()
, anddbRollback()
is now declared after the ellipsis. Code that calls these methods with
an unnamed second argument still works but receives a warning (#208). - The
select.cols
argument todbReadTable()
is deprecated, use
dbGetQuery()
with aSELECT
query instead (#185). - The methods related to tables (
dbReadTable()
,dbWriteTable()
,
dbExistsTable()
, anddbRemoveTable()
) always treat thename
argument as literal name, even if it contains backticks. This breaks the
CRAN version (but not the GitHub version) of the sqldf package (#188). dbWriteTable(append = TRUE)
raises an error if column names are not
the same in the data and the existing table (#165).dbFetch()
now errs forn < -1
, and acceptsn == Inf
.- Removed dummy
dbGetQuery()
method introduced for compatibility with
some Bioconductor packages (#187). sqlData()
now returns quoted strings, like the default
implementation in DBI (#207).dbWriteTable()
returns invisibly.- Now returning objects of type
blob
for blobs (#189). dbGetRowsAffected()
now returnsNA
for a statement with
placeholders, ifdbBind()
has not been called.- If a column contains incompatible values (e.g., numbers and strings),
a warning is raised indbFetch()
(#161). - Failing to set
PRAGMA cache_size
orPRAGMA synchronous
in
dbConnect()
now gives a clear warning (#197). - Improve warning message if named parameters are not used in
dbGetPreparedQuery()
ordbSendPreparedQuery()
(#193). - SQLite collects additional histogram data during
ANALYZE
, which may
lead to faster executions of queries (#124).
Bug fixes
- Identifiers are now escaped with backticks, to avoid ambiguous
handling of double quotes in the context of strings (#123). - Fix
dbBind()
behavior and tests. Attempting to bind to a query
without parameters throws an error (#114). - Fix corner case when repeatedly fetching from columns that don't have
an affinity. - The
variance()
andstdev()
extension functions now returnNULL
for input of length 1 (#201). - Fix roundtrip of
raw
columns (#116).
Documentation
- Remove redundant documentation, link to
DBI
more prominently (#186).
Internal
- Most DBItest tests now pass. Reduced number of skips shown for tests.
- C++ code now compiles with strict compiler settings
-Wall -Wextra -pedantic -Wconversion
. - Restore compatibility with older compilers/libraries by using
<boost/limits.hpp> (#206). - Use
boost/cstdint
instead of compound data type for 64-bit values
(#198). - Remove
Makevars.local
logic, resolve installation issues with
non-GNU Make (#203). - All methods of DBI are reexported.
- Registering native functions, as required by R >= 3.4.0.
- Use UTF-8 encoded file names as required by the SQLite API, to support
non-ASCII file names (#211). - Calling
dbFetch(n = 0)
instead ofdbFetch(n = 1)
in
dbListFields()
. - Exclude SQLite3 source code from coverage computation again (#204).
v1.1-2
v1.1-1
v1.1
RSQLite 1.1 (2016-11-25)
- New maintainer: Kirill Müller.
Bundled SQLite
- RSQLite always builds with the included source, which is located in
src/sqlite3
. This prevents bugs due to API mismatches and considerably simplifies the build process. - Current version: 3.11.1.
- Enable JSON1 extension (#152, @TigerToes).
- Include support for FTS5 (@mkuhn).
- Compilation limits
SQLITE_MAX_VARIABLE_NUMBER
andSQLITE_MAX_COLUMN
have been reset to the defaults. The documentation suggests setting to such high values is a bad idea. - Header files for
sqlite3
are no longer installed, linking to the package is not possible anymore. Packages that require access to the low-level sqlite3 API should bundle their own copy.
Breaking changes
RSQLite()
no longer automatically attaches DBI when loaded. This is to
encourage you to uselibrary(DBI); dbConnect(RSQLite::SQLite())
.- Functions that take a table name, such as
dbWriteTable()
anddbReadTable()
,
now quote the table name viadbQuoteIdentifier()
.
This means that caller-quoted names should be marked as such withDBI::SQL()
.
New features
- RSQLite has been rewritten (essentially from scratch) in C++ with
Rcpp. This has considerably reduced the amount of code, and allows us to
take advantage of the more sophisticated memory management tools available in
Rcpp. This rewrite should yield some minor performance improvements, but
most importantly protect against memory leaks and crashes. It also provides
a better base for future development. In particular, it is now technically
possible to have multiple result sets per connection, although this feature
is currently disabled (#150). - You can now use SQLite's URL specification for databases. This allows you to
create shared in-memory databases
(#70). - Queries (#69), query parameters and table data are always converted to UTF-8 before being sent to the database.
- Adapted to
DBI
0.5, new code should usedbExecute()
instead ofdbGetQuery()
, anddbSendStatement()
instead ofdbSendQuery()
where appropriate. - New strategy for prepared queries. Create a prepared query with
dbSendQuery()
ordbSendStatement()
and bind values withdbBind()
. The same query/statement can be executed efficiently multiple times by passing a data-frame-like object (#168, #178, #181). dbSendQuery()
,dbGetQuery()
,dbSendStatement()
anddbExecute()
also support inline parameterised queries,
likedbGetQuery(datasetsDb(), "SELECT * FROM mtcars WHERE cyl = :cyl", params = list(cyl = 4))
. This has no performance benefits but protects you
from SQL injection attacks.- Improve column type inference: the first non-
NULL
value decides the type of a column (#111). If there are no non-NULL
values, the column affinity is used, determined according to sqlite3 rules (#160). dbFetch()
uses the same row name strategy asdbReadTable()
(#53).dbColumnInfo()
will now return information even before you've retrieved any data.- New
sqliteVersion()
prints the header and library versions of RSQLite. - Deprecation warnings are given only once, with a clear reference to the source.
datasetsDb()
now returns a read-only database, to avoid modifications to the installed file.
Deprecated functions
make.db.names()
has been formally deprecated. Please usedbQuoteIdentifier()
instead. This function is also used indbReadTable()
,dbRemoveTable()
, anddbListFields()
(#106, #132).sqliteBuildTableDefinition()
has been deprecated. UseDBI::sqlCreateTable()
instead.dbGetException()
now raises a deprecation warning and always returnslist(errorNum = 0L, errorMsg = "OK")
, because querying the last SQLite error only works if an error actually occurred (#129).dbSendPreparedQuery()
anddbGetPreparedQuery()
have been reimplemented (with deprecation warning) usingdbSendQuery()
,dbBind()
anddbFetch()
for compatibility with existing packages (#100, #153, #168, #181). Please convert to the new API, because the old function may be removed completely very soon: They were never part of the official API, and do less argument checking than the new APIs. BothdbSendPreparedQuery()
anddbGetPreparedQuery()
ignore parameters not found in the query, with a warning (#174).- Reimplemented
dbListResults()
(with deprecation warning) for compatibility with existing packages (#154). - Soft-deprecated
dbGetInfo()
: The "Result" method is implemented by DBI, the methods for the other classes raise a warning (#137). It's now better to access the metadata with individual functionsdbHasCompleted()
,dbGetRowCount()
anddbGetRowsAffected()
. - All
summary()
methods have been removed: the same information is now displayed in theshow()
methods, which were previously pretty useless.
Compatibility fixes
- The
raw
data type is supported indbWriteTable()
, creates aTEXT
column with a warning (#173). - Numeric values for the
row.names
argument are converted to logical, with a warning (#170). - If the number of data frame columns matches the number of existing columns for
dbWriteTable(append = TRUE)
, columns will be matched by position for compatibility, with a warning in case of a name mismatch (#164). dbWriteTable()
supports thefield.types
argument when creating a new table (#171), and thetemporary
argument, defaultFALSE
(#113).- Reexporting
dbGetQuery()
anddbDriver()
(#147, #148, #183). sqliteCopyDatabase()
accepts character asto
argument again, in this case a temporary connection is opened.- Reimplemented
dbWriteTable("SQLiteConnection", "character", "character")
for import of CSV files, using a function from the old codebase (#151). dbWriteTable("SQLiteConnection", "character", "data.frame")
looks
for table names already enclosed in backticks and uses these,
(with a warning), for compatibility with the sqldf package.
Performance
- The
dbExistsTable()
function now works faster by filtering the list of tables using SQL (#166).
Documentation
- Start on a basic vignette:
vignette("RSQLite")
(#50). - Reworked function and method documentation, removed old documentation (#121).
- Using
dbExecute()
in documentation and examples. - Using both
":memory:"
and":file::memory:"
in documentation. - Added additional documentation and unit tests for
autoincrement keys (#119, @wibeasley).
Internal
- Avoid warning about missing
long long
data type in C++98 by using a compound data type built from two 32-bit integers, with static assert that the size is 8 indeed. - Remove all compilation warnings.
- All DBI methods contain an ellipsis
...
in their signature. Only thename
argument to the transaction methods appears before the ellipsis for compatibility reasons. - Using the
DBItest
package for testing (#105), with the newconstructor_relax_args
tweak. - Using the
plogr
for logging at the C++ level, can be enabled viaRSQLite:::init_logging()
. - Using new
sqlRownamesToColumn()
andsqlColumnToRownames()
(r-dbi/DBI#91). - Using
astyle
for code formatting (#159), also in tests (but only if sources can be located), stripped space at end of line in all source files. - Tracking dependencies between source and header files (#138).
- Moved all functions from headers to modules (#162).
- Fixed all warnings in tests (#157).
- Checking message wording for deprecation warnings (#157).
- Testing simple and named transactions (#163).
- Using container-based builds and development version of
testthat
on Travis. - Enabled AppVeyor testing.
- Differential reverse dependency checks.
- Added upgrade script for sqlite3 sources and creation script for the datasets database to the
data-raw
directory.