Running Sling
CLI Flags Overview
# Load all tables in a schema in with 3 threads
$ export SLING_THREADS=3
$ sling run \
--src-conn MY_SOURCE_DB \
--src-stream 'source_schema.*' \
--tgt-conn MY_TARGET_DB \
--tgt-object 'target_schema.{stream_table}'
--mode full-refresh
# Pipe in your json file and flatten the nested keys into their own columns
$ cat /tmp/my_file.json | sling run --src-options '{"flatten": "true"}' --tgt-conn MY_TARGET_DB --tgt-object 'target_schema.target_table' --mode full-refresh
# Read folder containing many CSV files
$ sling run \
--src-stream 'file:///tmp/my_csv_folder/' \
--tgt-conn MY_TARGET_DB --tgt-object 'target_schema.target_table' \
--mode full-refresh
# Load only latest data from one source DB to another.
$ sling run \
--src-conn MY_SOURCE_DB \
--src-stream 'source_schema.source_table' \
--tgt-conn MY_TARGET_DB \
--tgt-object 'target_schema.target_table' \
--mode incremental \
--primary-key 'id' --update-key 'last_modified_dt'
# Export / Backup database tables to JSON files
$ sling run \
--src-conn MY_SOURCE_DB \
--src-stream 'source_schema.source_table' \
--tgt-conn MY_S3_BUCKET \
--tgt-object 's3://my-bucket/my_json_folder/' \
--tgt-options '{"file_max_rows": 100000, "format": "jsonlines"}'Interface Specifications
CLI Flag
Description
Features
Last updated
Was this helpful?