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

299

Version

0.5.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Rasmus Skytte Randløv

Last Published

February 27th, 2025

Functions in SCDB (0.5.1)

id

Convenience function for DBI::Id
joins

SQL Joins
get_table

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

List the available tables on the connection
get_connection

Opens connection to the database
update_snapshot

Update a historical table
unique_table_name

Create a name for a temporary table
slice_time

Slices a data object based on time / date
get_catalog

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

Test if a schema exists in given connection
unite.tbl_dbi

tidyr::unite for tbl_dbi
table_exists

Test if a table exists in database
nrow

nrow() but also works on remote tables
%>%

Pipe operator
create_index

Create the indexes on table
defer_db_cleanup

Delete table at function exit
create_logs_if_missing

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

Determine the type of timestamps the database supports
LoggerNull

LoggerNull: The no-logging Logger
Logger

Logger: Complete logging to console, file and database
db_locks

Sets, queries and removes locks for database tables
create_table

Create a historical table from input data
close_connection

Close connection to the database
SCDB-package

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

Checks if table contains historical data
interlace

Combine any number of tables, where each has their own time axis of validity
digest_to_checksum

Computes an checksum from columns
filter_keys

Filters .data according to all records in the filter