Google Drive
Connect & Ingest data from / into Google Drive
Last updated
Was this helpful?
Was this helpful?
# Using service account key file
$ sling conns set GDRIVE type=gdrive key_file="/path/to/service-account-key.json"
# Using OAuth2 credentials
$ sling conns set GDRIVE type=gdrive client_id="your-client-id" client_secret="your-client-secret" access_token="your-access-token" refresh_token="your-refresh-token"
# Using a specific folder as root
$ sling conns set GDRIVE type=gdrive key_file="/path/to/key.json" folder_id="1abc2def3ghi4jkl5mno6pqr7stu8vwx"
# Direct file access by ID (read-only)
$ sling conns set GDRIVE type=gdrive key_file="/path/to/key.json" file_id="1xyz2abc3def4ghi5jkl6mno7pqr8stu"# Service account
export GDRIVE='{"type": "gdrive", "key_file": "/path/to/service-account-key.json"}'
# OAuth2
export GDRIVE='{"type": "gdrive", "client_id": "your-client-id", "client_secret": "your-client-secret", "access_token": "your-access-token", "refresh_token": "your-refresh-token"}'∂connections:
GDRIVE:
type: gdrive
key_file: /path/to/service-account-key.json
folder_id: 1abc2def3ghi4jkl5mno6pqr7stu8vwx
GDRIVE_OAUTH:
type: gdrive
client_id: your-client-id
folder_id: 1abc2def3ghi4jkl5mno6pqr7stu8vwx
client_secret: your-client-secret
access_token: your-access-token
refresh_token: your-refresh-token
GDRIVE_FOLDER:
type: gdrive
folder_id: 1abc2def3ghi4jkl5mno6pqr7stu8vwx # Use specific folder as root
key_body: |
{ "type": "service_account", ... }
GDRIVE_FILE:
type: gdrive
key_file: /path/to/service-account-key.json
file_id: 1xyz2abc3def4ghi5jkl6mno7pqr8stu # Direct file access (read-only)# List files in Google Drive
sling run --src-conn GDRIVE --src-stream "folder/file.csv" --stdout
# Copy from local to Google Drive
sling run --src-stream file:///path/to/local.csv --tgt-conn GDRIVE --tgt-object "folder/remote.csv"
# Copy from Google Drive to database
sling run --src-conn GDRIVE --src-stream "data/file.csv" --tgt-conn MYDB --tgt-object "schema.table"
# Use wildcard patterns
sling run --src-conn GDRIVE --src-stream "reports/*.json" --stdout