Manage database, file system, and API connections for Sling. Use when setting up connections, testing connectivity, discovering tables/files, or configuring credentials.
Connections are named endpoints for databases, file systems, and APIs. Sling stores them in ~/.sling/env.yaml.
| Type | Examples | Kind |
|---|---|---|
| Database | postgres, mysql, snowflake, bigquery | database |
| File System | s3, gcs, azure, sftp, local | file |
| API | Custom REST APIs via specs | api |
{"action": "list", "input": {}}
{
"action": "test",
"input": {
"connection": "MY_POSTGRES",
"debug": true
}
}
{
"action": "discover",
"input": {
"connection": "MY_POSTGRES",
"pattern": "public.*",
"columns": true
}
}
{
"action": "set",
"input": {
"name": "MY_POSTGRES",
"properties": {
"type": "postgres",
"host": "localhost",
"user": "myuser",
"database": "mydb"
}
}
}
sling conns list # List all
sling conns test MY_POSTGRES --debug # Test
sling conns discover MY_POSTGRES --pattern "public.*" # Discover
sling conns exec MY_POSTGRES -q "SELECT 1" # Execute SQL
export MY_POSTGRES='host=localhost user=postgres dbname=mydb'
export MY_POSTGRES='postgresql://user:pass@host:5432/dbname'
# ~/.sling/env.yaml