Skip to contents

Core Database Classes

Main R6 classes for database connection and table management

DBConnection_v9
R6 Class representing a database connection
DBTable_v9
R6 Class representing a database table

Database Utilities

Helper functions for database operations and metadata

get_table_names_and_info()
Get table names, number of rows, and size information
insert_data_many()
Insert data into several tables in one transaction
csdb_set_auth_hook()
Set authentication hook for database connections
csdb_get_auth_hook()
Get the current authentication hook
csdb_set_password_hook()
Set the password hook for PostgreSQL connections
csdb_get_password_hook()
Get the current password hook
csdb_set_context()
Set the caller context
csdb_get_context()
Get the caller context
csdb_connection_is_alive()
Does a database connection still reach its server?
setorder_by_pk()
Order a data.table by the primary key of a table
set_pk()
Attach a primary key to a lazy table
collect_and_sort_by_pk()
Collect a query and order it by the primary key of its table

Data Validation

Functions for validating field types and data contents

validator_field_types_blank()
Blank field types validator
validator_field_types_csfmt_rts_data_v1()
Field types validator for csfmt_rts_data_v1 schema
validator_field_types_csfmt_rts_data_v2()
Field types validator for csfmt_rts_data_v2 schema
validator_field_contents_blank()
Blank data contents validator
validator_field_contents_csfmt_rts_data_v1()
Field contents validator for csfmt_rts_data_v1 schema
validator_field_contents_csfmt_rts_data_v2()
Field contents validator for csfmt_rts_data_v2 schema

Synthetic Data

Profiles, simulation, and the synthetic data contract of one table

profile_query()
Profile the result of a SQL query
profile_table()
Profile a DBTable_v9
profile_data()
Profile a data frame
profile_schema()
A profile that holds only a schema
write_profile()
Write a profile to a YAML file
read_profile()
Read a profile from a YAML file
simulate_from_profile()
Simulate a table from a profile
profile_compare()
Compare two profiles
SyntheticTable
The synthetic data contract of one table
synthetic_table_from_dir()
Build a SyntheticTable from a directory

Datasets

Example datasets included with the package

nor_covid19_cases_by_time_location
Covid-19 data for PCR-confirmed cases in Norway (nation and county)