Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Rprof\.out
^\.Rproj\.user$
^doc$
^Meta$
^\.github$
^_pkgdown\.yml$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
51 changes: 51 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
49 changes: 49 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
62 changes: 62 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v5
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Package: storr
Title: Simple Key Value Stores
Version: 1.2.5
Version: 1.2.6
Description: Creates and manages simple key-value stores. These can
use a variety of approaches for storing the data. This package
implements the base methods and support for file system, in-memory
and DBI-based database stores.
Depends:
R (>= 3.3.0)
License: MIT + file LICENSE
LazyData: true
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "rich.fitzjohn@gmail.com"),
person(c("William", "Michael"), "Landau",
email = "will.landau@gmail.com",
role = "ctb",
comment = c(ORCID = "0000-0003-1878-3253")
))
URL: https://github.com/richfitz/storr
URL: https://richfitz.github.io/storr/, https://github.com/richfitz/storr
BugReports: https://github.com/richfitz/storr/issues
Imports:
R6 (>= 2.1.0),
Expand All @@ -33,5 +32,7 @@ Suggests:
rmarkdown,
testthat (>= 3.0.0)
VignetteBuilder: knitr
RoxygenNote: 6.1.1
RoxygenNote: 7.3.2
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Language: en-GB
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ check_all: build
autodoc:
${RSCRIPT} autodoc.R process

vignettes/storr.Rmd: vignettes_src/storr.R
${RSCRIPT} -e 'library(sowsear); sowsear("$<", output="$@")'
vignettes/external.Rmd: vignettes_src/external.R
${RSCRIPT} -e 'library(sowsear); sowsear("$<", output="$@")'
vignettes: vignettes/storr.Rmd vignettes/external.Rmd
${RSCRIPT} -e 'library(methods); devtools::build_vignettes()'

Expand Down
10 changes: 5 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
## storr 1.1.3 (2017-12-15)

* Only use version 2 serialisation, avoiding breakage when version 3 is released in 3.5.0 (#62, reported by Tomas Kalibera)
* Quote sql more safely (#60, reported by @wlandau)
* Quote SQL more safely (#60, reported by @wlandau)
* Support for duplicating (`$duplicate`) and filling (`$fill`) keys with identical values, without duplicating or reserialising data (#56, requested by @wlandau)
* Moved to a shiny new [pkgdown](https://pkgdown.r-lib.org/) website - https://richfitz.github.com/storr
* Moved to a shiny new [`pkgdown`](https://pkgdown.r-lib.org/) website - https://richfitz.github.com/storr

## storr 1.1.2 (2017-09-08)

Expand All @@ -33,18 +33,18 @@

## storr 1.1.0 (2017-05-05)

* Support for using relational databases via DBI (SQLite, Postgres) #23 - MySQL and Microsoft SQL Server support is not implemented yet
* Support for using relational databases via DBI (`SQLite`, Postgres) #23 - MySQL and Microsoft SQL Server support is not implemented yet
* Support for selecting hash algorithm at the driver level, so rather than being limited to md5, more robust algorithms can be used. This is implemented for all storr drivers, and for the rds driver will safely work on storr databases from before this version
* `mget`/`mset`/`mset_by_value` added for vectorised `get`/`set`/`set_by_value` operations that reduce the number of roundtrips on some drivers. `del` and `exists` become vectorised at the same time. This requires extensive change to drivers but is backward compatible for users.
* Large object support for rds is slightly improved (#25) but still very slow
* Storr now supports exporting multiple namespaces at once (possibly all namespaces) making it easier migrate large amounts of data between storrs. This does cause a small breaking change where `$import()` now returns a matrix with columns `name`, `namespace` indicating what was imported (previously this was just a vector)
* Storr import/export more gracefully handles missing keys
* RDS storrs no longer pad base64 filenames with trailing with `=` which reduces the number of possily problematic characters. Existing storrs are unaffected (#43)
* RDS storrs no longer pad base64 filenames with trailing with `=` which reduces the number of possibly problematic characters. Existing storrs are unaffected (#43)
* RDS storrs are not left in an inconsistent state if RDS file writing fails (#40, thanks @krlmlr)

## storr 1.0.1 (2016-05-10)

* Updated to work with recent testthat (>= 1.0.0)
* Updated to work with recent `testthat` (>= 1.0.0)
* Limited support for writing out very large serialised objects (rds)

## storr 1.0.0 (2016-01-19)
Expand Down
4 changes: 2 additions & 2 deletions R/base64.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
##' @param char62 Character to use for the 62nd index
##' @param char63 Character to use for the 63rd index
##' @param pad Logical, indicating if strings should be padded with
##' \code{=} characters (as RFC 4648 requires)
##' `=` characters (as RFC 4648 requires)
##' @export
##' @examples
##' x <- encode64("hello")
Expand Down Expand Up @@ -47,7 +47,7 @@ encode64 <- function(x, char62 = "-", char63 = "_", pad = TRUE) {


##' @param error Throw an error if the decoding fails. If
##' \code{FALSE} then \code{NA_character_} values are returned for
##' `FALSE` then `NA_character_` values are returned for
##' failures.
##'
##' @export
Expand Down
16 changes: 8 additions & 8 deletions R/defunct.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
##' Defunct functions
##'
##' The redis functions (\code{driver_redis_api} and
##' \code{storr_redis_api}) have been moved out of this package and
##' into Redis. I don't believe anyone is using them at the time of
##' the move so this is being done fairly abruptly - this is
##' unfortunate, but necessary to avoid a circular dependency! The
##' new functions are simply \code{redux::driver_redis_api} and
##' \code{redux::storr_redis_api}, along with a helper function
##' \code{redux::storr_hiredis} which also creates the connection.
##' The Redis functions (`driver_redis_api` and `storr_redis_api`)
##' have been moved out of this package and into `redux`. I don't
##' believe anyone is using them at the time of the move so this is
##' being done fairly abruptly - this is unfortunate, but necessary to
##' avoid a circular dependency! The new functions are simply
##' `redux::driver_redis_api` and `redux::storr_redis_api`, along with
##' a helper function `redux::storr_hiredis` which also creates the
##' connection.
##'
##' @title Defunct functions
##' @param ... parameters (now all dropped as dots)
Expand Down
25 changes: 12 additions & 13 deletions R/driver_dbi.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
##' Object cache driver using the "DBI" package interface for storage.
##' This means that storr can work for any supported "DBI" driver
##' (though practically this works only for SQLite and Postgres until
##' (though practically this works only for `SQLite` and Postgres until
##' some MySQL dialect translation is done). To connect, you must
##' provide the \emph{driver} object (e.g., \code{RSQLite::SQLite()},
##' or \code{RPostgres::Postgres()} as the first argument.
##' provide the *driver* object (e.g., `RSQLite::SQLite()`,
##' or `RPostgres::Postgres()` as the first argument.
##'
##' Because the DBI package specifies a uniform interface for the
##' using DBI compliant databases, you need only to provide a
Expand All @@ -17,18 +17,18 @@
##' writing). Apart from that the names do not matter.
##'
##' Because of treatment of binary data by the underlying DBI drivers,
##' binary serialistion is not any faster (and might be slightly
##' binary serialisation is not any faster (and might be slightly
##' slower than) string serialisation, in contrast with my experience
##' with other backends.
##'
##' storr uses DBI's "prepared query" approach to safely interpolate
##' keys, namespaces and values into the database - this should allow
##' odd characters without throwing SQL syntax errors. Table names
##' can't be interpolated in the same way - these storr simply quotes,
##' but validates beforehand to ensure that \code{tbl_data} and
##' \code{tbl_keys} do not contain quotes.
##' but validates beforehand to ensure that `tbl_data` and
##' `tbl_keys` do not contain quotes.
##'
##' Be aware that \code{$destroy()} will close the connection to the
##' Be aware that `$destroy()` will close the connection to the
##' database.
##'
##' @title DBI storr driver
Expand All @@ -40,24 +40,23 @@
##' @param con Either A DBI connection or a DBI driver (see example)
##'
##' @param args Arguments to pass, along with the driver, to
##' \code{DBI::dbConnect} if \code{con} is a driver.
##' `DBI::dbConnect` if `con` is a driver.
##'
##' @param binary Optional logical indicating if the values should be
##' stored in binary. If possible, this is both (potentially
##' faster) and more accurate. However, at present it is supported
##' only under very recent DBI and RSQLite packages, and for no
##' only under very recent `DBI` and `RSQLite` packages, and for no
##' other DBI drivers, and is not actually any faster. If not given
##' (i.e., \code{NULL}), then binary storage will be used where
##' (i.e., `NULL`), then binary storage will be used where
##' possible when creating new tables, and where tables exist, we
##' use whatever was used in the existing tables.
##'
##' @param hash_algorithm Name of the hash algorithm to use. Possible
##' values are "md5", "sha1", and others supported by
##' \code{\link{digest}}. If not given, then we will default to
##' [digest::digest]. If not given, then we will default to
##' "md5".
##'
##' @param default_namespace Default namespace (see
##' \code{\link{storr}}).
##' @param default_namespace Default namespace (see [storr]).
##'
##' @export
##' @examples
Expand Down
Loading