Skip to contents

Constructs the full database table name for HTS tables, applying mapping, prefix, and version suffix as needed. Use to standardize table names for database queries and file I/O.

Usage

get_db_table_name(table, settings)

Arguments

table

character(1). Logical or database table name (e.g., 'household', 'person', 'ex_hh').

settings

list. Must include:

  • hts_table_map — optional mapping of logical to database table names

  • hts_tables_prefix — optional prefix for standard HTS tables

  • hts_rmove_version — optional version suffix for rMove tables Additional settings as needed for table naming.

Value

character(1). Fully resolved database table name.

Details

  • Checks for a table mapping in settings$hts_table_map; returns mapped name if found.

  • For standard HTS tables, applies prefix from settings$hts_tables_prefix if present.

  • Appends version suffix from settings$hts_rmove_version if present.

  • Returns the original table name for non-standard tables.

  • Returns a character string suitable for database queries or file paths.

Settings

  • hts_table_map (direct): Table name mapping. Default from settings.

  • hts_tables_prefix (direct): Table prefix. Default from settings.

  • hts_rmove_version (direct): Version suffix. Default from settings.

Examples

## Not run:
settings <- list(hts_table_map = list(household = 'ex_hh'), hts_tables_prefix = 'hts', hts_rmove_version = 'v2')
get_db_table_name('household', settings) # returns 'hts_household_v2' or mapped name
#> [1] "ex_hh"
## End(Not run)