Learn R Programming

SCDB

Overview

SCDB is a package for easily maintaining and updating data with a slowly changing dimension. More specifically, the package facilitates type-2 history for data warehouses and provide a number of quality-of-life improvements for working with SQL databases within R.

To better understand what a slowly changing dimension is and how and this packages provides it, see vignette("slowly-changing-dimension").

Installation

# Install SCDB from CRAN:
install.packages("SCDB")

# Alternatively, install the development version from github:
# install.packages("devtools")
devtools::install_github("ssi-dk/SCDB")

Usage

For basic usage examples, see vignette("SCDB").

Copy Link

Version

Install

install.packages('SCDB')

Monthly Downloads

584

Version

0.6.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Rasmus Skytte Randløv

Last Published

January 23rd, 2026

Functions in SCDB (0.6.0)

joins

SQL Joins
%>%

Pipe operator
slice_time

Slices a data object based on time / date
table_exists

Test if a table exists in database
id

Convenience function for DBI::Id
unique_table_name

Create a name for a temporary table
unite.tbl_dbi

tidyr::unite for tbl_dbi
schema_exists

Test if a schema exists in given connection
update_snapshot

Update a historical table
nrow

nrow() but also works on remote tables
create_logs_if_missing

Create a table with the SCDB log structure if it does not exists
db_locks

Sets, queries and removes locks for database tables
create_table

Create a historical table from input data
LoggerNull

LoggerNull: The no-logging Logger
db_timestamp

Determine the type of timestamps the database supports
close_connection

Close connection to the database
SCDB-package

SCDB: Easily Access and Maintain Time-Based Versioned Data (Slowly-Changing-Dimension)
create_index

Create the indexes on table
Logger

Logger: Complete logging to console, file and database
defer_db_cleanup

Delete table at function exit
delta_loading

Import and export a data-chunk with history from historical data
digest_to_checksum

Computes an checksum from columns
get_catalog

Get the current schema/catalog of a database-related objects
get_table

Retrieves a named table from a given schema on the connection
interlace

Combine any number of tables, where each has their own time axis of validity
is.historical

Checks if table contains historical data
get_tables

List the available tables on the connection
get_connection

Opens connection to the database
filter_keys

Filters .data according to all records in the filter