SqlImport.Rd
Manage SQL based data import.
Manage SQL based data import.
This object should not be initialised directly. Use dettl
to
create the object.
Import can be run by working with import object returned by
dettl
or by running top-level functions. Run the import by
working with this object if you want to step through the import process
stage by stage and inspect the data after each stage.
dettl::Import
-> SqlImport
Inherited methods
dettl::Import$begin_transaction()
dettl::Import$commit_transaction()
dettl::Import$extract()
dettl::Import$format()
dettl::Import$get_connection()
dettl::Import$get_log_table()
dettl::Import$help()
dettl::Import$initialize()
dettl::Import$load()
dettl::Import$pre_modify_checks()
dettl::Import$rollback_transaction()
dettl::Import$run_import()
dettl::Import$transform()
reload()
Reload the objects sources to refresh source code or repair a broken Postgres connection.
path <- dettl:::prepare_test_import(
system.file("examples", "sql_example", package = "dettl"),
system.file("examples", "dettl_config.yml", package = "dettl"))
import_path <- file.path(path, "sql_example")
import <- dettl::dettl(import_path, db_name = "test")
import$run_import(stage = c("extract", "transform", "load"))
#> No extract function defined for this import, skipping step
#> No transform function defined for this import, skipping step
#> Running load /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpiqOfW1/file14a96a3d9bd9/sql_example
#> Running load in a transaction:
#> - Running test queries before making any changes
#> - Running load step
#> - Running test queries after making changes
#> - Running load tests R/test_load.R
#> ✔ | F W S OK | Context
#>
#> ⠏ | 0 | load
#> ⠏ | 0 | counts-test
#> ✔ | 1 | counts-test
#>
#> ══ Results ═════════════════════════════════════════════════════════════════════
#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ]
#> All tests passed, commiting changes to database.