Ingest data with Sling
Sling is a data movement tool that replicates tables between databases, data warehouses, and file systems. In this step, you'll configure Sling to copy tables from Postgres to DuckDB and register each table as a Dagster asset.
Step 1: Scaffold the Sling component
Use dg scaffold to create the component folder:
dg scaffold defs dagster_sling.SlingReplicationCollectionComponent sling_ingest
This creates a sling_ingest folder with two files:
src/project_elt_pipeline/defs/
└── sling_ingest/
├── defs.yaml
└── replication.yaml
defs.yaml already has the necessary configuration and is ready to use:
src/project_elt_pipeline/defs/sling_ingest/defs.yaml
type: dagster_sling.SlingReplicationCollectionComponent
attributes:
replications:
- path: replication.yaml
replication.yaml is where you define what to replicate and where to send it, which we cover in the next step.