Skip to content

Instantly share code, notes, and snippets.

@jatorre
Created October 15, 2012 12:07
Show Gist options
  • Save jatorre/3892131 to your computer and use it in GitHub Desktop.
Save jatorre/3892131 to your computer and use it in GitHub Desktop.
#in myquery.sql you can have a VEERY BIG SQL file that you need to run on CartoDB, like a huge INSERT or UPDATE
curl --data "api_key=XXXXXXXXXXXXXXXXXXXXXXXXX&q=`cat myquery.sql`" https://jatorre.cartodb.com/api/v1/sql
@jatorre
Copy link
Author

jatorre commented Oct 15, 2012

Obviously you need to specify the api_key which you can find on the dashboard of CartoDB->API keys->API KEY

Also on the URL you see jatorre, replace it for your username

@palanik
Copy link

palanik commented Oct 15, 2012

I am using similar syntax:
curl -d @myquery.sql 'https://xxxxx.cartodb.com/api/v2/sql/?api_key=XXXXXXXXXXXXXXXXXX'

This allows curl to read the file directly, rather than invoking cat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment