bcgov / bcgov/wqbench

`wqb_create_epa_ecotox()` table creation

Open
#4 3 comments 0 reactions 0 assignees View on GitHub
Priority: 5 Don't Do! Type: Enhancement
Dominant language
R
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently the tables are created by passing a list of the table names and the corresponding primary keys

```
db_tbl_core_structure <- function() {
# names are table names, values are primary keys
list(
"chemical_carriers" = "carrier_id",
"dose_response_details" = "dose_resp_detail_id",
"dose_response_links" = "dose_resp_link_id",
"dose_responses" = "dose_resp_id",
"doses" = "dose_id",
"media_characteristics" = "result_id",
"results" = "result_id",
"tests" = "test_id"
)
}

### there are about 40 reference/validation tables but not all being pk'ed
db_tbl_validation_structure <- function() {
# names are table names, values are primary keys
list(
"application_frequency_codes" = "code",
"application_type_codes" = "code",
"chemical_analysis_codes" = "code",
"chemical_formulation_codes" = NULL,
"chemical_grade_codes" = NULL,
"chemicals" = "cas_number",
"concentration_type_codes" = NULL,
"concentration_unit_codes" = NULL,
"control_type_codes" = NULL,
"dose_stat_method_codes" = NULL,
"duration_unit_codes" = NULL,
"effect_codes" = "code",
"endpoint_assigned_codes" = NULL,
"endpoint_codes" = NULL,
"exposure_type_codes" = "code",
"field_study_type_codes" = "code",
"gender_codes" = "code",
"geographic_codes" = NULL,
"habitat_codes" = NULL,
"ion_codes" = NULL,
"lifestage_codes" = "code",
"measurement_codes" = "code",
"media_char_unit_codes" = NULL,
"media_type_codes" = "code",
"organic_matter_type_codes" = NULL,
"organism_source_codes" = "code",
"radio_label_codes" = NULL,
"references" = "reference_number", # make sure tbl name isnt issue
"response_site_codes" = "code",
"sample_size_unit_codes" = NULL,
"season_codes" = NULL,
"species_synonyms" = NULL,
"species" = "species_number",
"statistical_significance_codes" = NULL,
"substrate_codes" = NULL,
"test_location_codes" = "code",
"test_method_codes" = "code",
"test_type_codes" = "code",
"trend_codes" = "code",
"weight_unit_codes" = NULL
)
}
```

Contributor guide

Open the contributing guide

Research direction

Start at wqb_create_epa_ecotox() and review db_tbl_core_structure() and db_tbl_validation_structure(), including which entries have primary keys. The issue does not state the intended table-creation behavior or identify tests or files, so confirm the target schema and completion checks before changing anything.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.