MyNixOS website logo
Description

Store Tables in SQL Database.

Provides functions for quickly writing (and reading back) a data.frame to file in 'SQLite' format. The name stands for *Store Tables using 'SQLite'*, or alternatively for *Quick Store Tables* (either way, it could be pronounced as *Quest*). For data.frames containing the supported data types it is intended to work as a drop-in replacement for the 'write_*()' and 'read_*()' functions provided by similar packages.

This package provides functions for quickly writing (and reading back) a data.frame to file in sqlite format. The name stands for Store Tables using SQLite, or alternatively for Quick Store Tables (either way, it could be pronounced as Quest). For data.frames containing the supported data types it is intended to work as a drop-in replacement for the write_*() and read_*() functions provided by packages such as fst, feather, qs, and readr packages (as well as the writeRDS() and readRDS() functions).

The core functions are read_qst() and write_qst(), which read/write a data.frame from/to a SQLite database. The database contains a single table named data, which contains the data from the data.frame.

The package wraps the functionality of RSQLite and dbplyr, which do the heavy lifting. The resulting file is reasonably small and the read/write process for a complete file is reasonably fast, although no claims are made of superiority to the above packages that focus on these issues.

This packages shines in the ability to quickly and easily switch from loading a complete data.frame to using dbplyr/SQLite to subset data on disk before loading it into memory. This is done simply by setting the lazy parameter of read_qst() to TRUE:

write_qst(dat_org, "dat.qst")         # A reasonably large data set
dat_full <- read_qst("dat.qst")       # Reasonably quick
dat <- read_qst("dat.qst", lazy=TRUE) # Near instanteous
dat                                   # Prints out nicely using dbplyr
dat %>% filter(state=="AZ")           # Filtered from disk using SQLite

Filtering from disk (as shown in the last line) is reasonably fast (typically much faster than loading the whole data set before then filtering in memory), even without indexes. With indexes, which can be created on write with the indexes and unique_indexes arguments to write_qst(), it becomes even faster.

Road map

The following features are planned in future releases:

  • Support dates
  • Support factors
  • Support logical data types
  • Support variable labels
  • Support value labels

If you are using qst and would like a specific feature to be implemented, either from the road map or another feature, the simplest way to request it is by opening an issue.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows