Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork57
Sling is a CLI tool that extracts data from a source storage/database and loads it in a target storage/database.
License
slingdata-io/sling-cli
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Slings from a data source to a data target.
Seedocs.slingdata.io for more details.
Sling is a passion project turned into a free CLI Product which offers an easy solution to create and maintain small to medium volume data pipelines using the Extract & Load (EL) approach. It focuses on data movement between:
- Database to Database
- File System to Database
- Database to File System
sling.demo.2023.10.4k.mp4
Some key features:
- Single Binary deployment (built with Go). Seeinstallation page.
- Use Custom SQL as a stream:
--src-stream='select * from my_table where col1 > 10' - Manage / View / Test / Discover your connections with the
sling connssub-command - Use Environment Variable as connections if you prefer (
export MY_PG='postgres//...)' - Provide YAML or JSON configurations (perfect for git version control).
- PowerfulReplication logic, to replication many tables with a wildcard (
my_schema.*). - Reads your existingDBT connections
- Use your environment variable in your YAML / JSON config (
select * from my_table where date = '{date}') - ConvenientTransformations, such as the
flattenoption, which auto-creates columns from your nested fields. - Run Pre & Post SQL commands.
- many more!
ExampleReplication:
Available Connectors:
Databases:
bigquerybigtableclickhouseduckdbmariadbmotherduckmysqloraclepostgresredshiftsnowflakesqlitesqlserverstarrocksprometheusprotondatabricksexasolFile Formats:
csv,parquet,xlsx,json,avro,xml,sas7bday
Here are some additional links:
Ever wanted to quickly pipe in a CSV or JSON file into your database? Use sling to do so:
cat my_file.csv| sling run --tgt-conn MYDB --tgt-object my_schema.my_tableOr want to copy data between two databases? Do it with sling:
sling run --src-conn PG_DB --src-stream public.transactions \ --tgt-conn MYSQL_DB --tgt-object mysql.bank_transactions \ --mode full-refresh
Sling can also easily manage our local connections with thesling conns command:
$ sling connsset MY_PG url='postgresql://postgres:myPassword@pghost:5432/postgres'$ sling conns list+--------------------------+-----------------+-------------------+| CONN NAME| CONN TYPE| SOURCE|+--------------------------+-----------------+-------------------+| AWS_S3| FileSys - S3| sling env yaml|| FINANCE_BQ| DB - BigQuery| sling env yaml|| DO_SPACES| FileSys - S3| sling env yaml|| LOCALHOST_DEV| DB - PostgreSQL| dbt profiles yaml|| MSSQL| DB - SQLServer| sling env yaml|| MYSQL| DB - MySQL| sling env yaml|| ORACLE_DB| DB - Oracle| env variable|| MY_PG| DB - PostgreSQL| sling env yaml|+--------------------------+-----------------+-------------------+$ sling conns discover LOCALHOST_DEV9:05AM INF Found 344 streams: -"public"."accounts" -"public"."bills" -"public"."connections" ...
brew install slingdata-io/sling/sling# You're good to go!sling -hscoop bucket add sling https://github.com/slingdata-io/scoop-sling.gitscoop install sling# You're good to go!sling-h
curl -LO'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_linux_amd64.tar.gz' \&& tar xzf sling_linux_amd64.tar.gz \&& rm -f sling_linux_amd64.tar.gz# You're good to go!sling -h
Requirements:
- Install Go 1.22+ (https://go.dev/doc/install)
- Install a C compiler (gcc,tdm-gcc,mingw, etc)
git clone https://github.com/slingdata-io/sling-cli.gitcd sling-clibash scripts/build.sh./sling --helpgit clone https://github.com/slingdata-io/sling-cli.gitcd sling-cli.\scripts\build.ps1.\sling --help
pip install sling
Then you should be able to runsling --help from command line.
Repository link:https://github.com/slingdata-io/sling-python
Here are the links of the official development builds, which are the latest builds of the upcoming release.
- Linux (x64):https://f.slingdata.io/dev/latest/sling_linux_amd64.tar.gz
- Mac (arm64):https://f.slingdata.io/dev/latest/sling_darwin_arm64.tar.gz
- Windows (x64):https://f.slingdata.io/dev/latest/sling_windows_amd64.tar.gz
If you're using the python wrapper, decompress the downloaded binary and put the path in the environment variableSLING_BINARY before running your python program.
We welcome contributions to improve Sling! Here are some guidelines to help you get started.
When creating a new branch for your contribution, please use the following naming convention:
feature/your-feature-namefor new featuresbugfix/issue-descriptionfor bug fixesdocs/update-descriptionfor documentation updates
Sling has three main test suites: Database, File and CLI. When contributing, please ensure that your changes pass the relevant tests.
To run the full test suite, run below. However you'd need to define all the needed connections as shownhere, so it's recommended to target specific tests instead.
./scripts/build.sh./scripts/test.sh
You can target specific tests or suites using environment variables:
Database Suite:
cd cmd/slinggotest -v -run TestSuiteDatabasePostgres# run all Postgres testsgotest -v -run TestSuiteDatabasePostgres -- 1-3# run Postgres tests 1, 2, 3
File Suite:
cd cmd/slinggotest -v -run TestSuiteFileS3# run all S3 testsgotest -v -run TestSuiteFileS3 -- 1,2,3# run S3 tests 1, 2, 3
CLI Suite:
cd cmd/slingexport SLING_BIN=./slinggotest -v -run TestCLI# run all CLI testsgotest -v -run TestCLI -- 31+# run CLI tests 31 and all subsequent tests
You can specify individual test numbers, ranges, or use the '+' suffix to run all tests from a certain number:
go test -v -run TestCLI -- "1,2,3": Run tests 1, 2, and 3go test -v -run TestSuiteFileS3 -- "1-5": Run tests 1 through 5go test -v -run TestCLI -- "3+": Run test 3 and all subsequent tests
Database Suite: Tests database-related functionality.
- Located in:
cmd/sling/sling_test.go - Configuration:
cmd/sling/tests/suite.db.template.tsv
- Located in:
File Suite: Tests file system operations.
- Located in:
cmd/sling/sling_test.go - Configuration:
cmd/sling/tests/suite.file.template.tsv
- Located in:
CLI Suite: Tests command-line interface functionality.
- Located in:
cmd/sling/sling_cli_test.go - Configuration:
cmd/sling/tests/suite.cli.yaml
- Located in:
When introducing new features or addressing bugs, it's essential to incorporate relevant tests, focusing mainly on the CLI suite file located atcmd/sling/suite.cli.yaml. The database and file suites serve as templates applicable across all connectors, making them more sensitive to modifications. Therefore, any changes to these suites will be managed internally.
When adding new test entries in the CLI suite file, feel free to create a new replication file in foldercmd/sling/tests/replications, or a corresponding source file in thecmd/sling/tests/files directory. Also include the expected output or the number of expected rows/streams in the new test entry.
- Ensure your code adheres to the existing style and passes all tests.
- Update the README.md with details of changes to the interface, if applicable.
- Create a Pull Request with a clear title and description.
Thank you for contributing to Sling!
About
Sling is a CLI tool that extracts data from a source storage/database and loads it in a target storage/database.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors14
Uh oh!
There was an error while loading.Please reload this page.

