Package: SCDB 0.5.0

Rasmus Skytte Randløv

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

A collection of functions that enable easy access and updating of a database of data over time. More specifically, the package facilitates type-2 history for data-warehouses and provides a number of Quality of life improvements for working on SQL databases with R. For reference see Ralph Kimball and Margy Ross (2013, ISBN 9781118530801).

Authors:Rasmus Skytte Randløv [aut, cre, rev], Marcus Munch Grünewald [aut], Lasse Engbo Christiansen [rev], Sofia Myrup Otero [rev], Statens Serum Institut [cph, fnd]

SCDB_0.5.0.tar.gz
SCDB_0.5.0.tar.gz(r-4.5-noble)SCDB_0.5.0.tar.gz(r-4.4-noble)
SCDB_0.5.0.tgz(r-4.4-emscripten)SCDB_0.5.0.tgz(r-4.3-emscripten)
SCDB.pdf |SCDB.html
SCDB/json (API)
NEWS

# Install 'SCDB' in R:
install.packages('SCDB', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ssi-dk/scdb/issues

Pkgdown site:https://ssi-dk.github.io

4.13 score 1 packages 194 downloads 27 exports 30 dependencies

Last updated 4 days agofrom:b307c8af70. Checks:2 OK. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKFeb 03 2025
R-4.5-linuxOKFeb 03 2025

Exports:%>%close_connectioncreate_indexcreate_logs_if_missingcreate_tabledb_timestampdefer_db_cleanupdigest_to_checksumfilter_keysget_catalogget_connectionget_schemaget_tableget_tablesidinterlaceis.historicallock_tableLoggerLoggerNullnrowschema_existsslice_timetable_existsunique_table_nameunlock_tableupdate_snapshot

Dependencies:askpassbackportsblobcheckmateclicpp11DBIdbplyrdplyrfansigenericsgluelifecyclemagrittropensslparallellypillarpkgconfigpurrrR6rlangstringistringrsystibbletidyrtidyselectutf8vctrswithr

SCDB: Basic principles

Rendered fromSCDB.Rmdusingknitr::rmarkdownon Feb 03 2025.

Last update: 2025-02-03
Started: 2024-03-22

SCDB: Benchmarks

Rendered frombenchmarks.Rmdusingknitr::rmarkdownon Feb 03 2025.

Last update: 2025-02-03
Started: 2025-02-03

Slowly Changing Dimension methodology

Rendered fromslowly-changing-dimension.Rmdusingknitr::rmarkdownon Feb 03 2025.

Last update: 2025-02-03
Started: 2023-12-01

Readme and manuals

Help Manual

Help pageTopics
Close connection to the databaseclose_connection
Create the indexes on tablecreate_index
Create a table with the SCDB log structure if it does not existscreate_logs_if_missing
Create a historical table from input datacreate_table
Sets, queries and removes locks for database tablesdb_locks lock_table unlock_table
Determine the type of timestamps the database supportsdb_timestamp
Delete table at function exitdefer_db_cleanup
Computes an checksum from columnsdigest_to_checksum
Filters .data according to all records in the filterfilter_keys
Get the current schema/catalog of a database-related objectsget_catalog get_catalog.Microsoft SQL Server get_schema get_schema.PqConnection get_schema.SQLiteConnection
Opens connection to the databaseget_connection get_connection.default get_connection.duckdb_driver get_connection.OdbcDriver get_connection.PqDriver get_connection.SQLiteDriver
Retrieves a named table from a given schema on the connectionget_table
List the available tables on the connectionget_tables
Convenience function for DBI::Idid id.character id.data.frame id.Id
Combine any number of tables, where each has their own time axis of validityinterlace
Checks if table contains historical datais.historical
SQL Joinsanti_join.tbl_sql full_join.tbl_sql inner_join.tbl_sql joins left_join.tbl_sql right_join.tbl_sql semi_join.tbl_sql
Logger: Complete logging to console, file and databaseLogger
LoggerNull: The no-logging LoggerLoggerNull
nrow() but also works on remote tablesnrow
Test if a schema exists in given connectionschema_exists
Slices a data object based on time / dateslice_time
Test if a table exists in databasetable_exists table_exists.DBIConnection
Create a name for a temporary tableunique_table_name
tidyr::unite for tbl_dbiunite.tbl_dbi
Update a historical tableupdate_snapshot