Use SQL to query a cloud postgres database. This works with Redshift, Heroku, and any Postgres db with a database URL you can access.
Be careful who you give access to this block. Users authenticated with this block will be able to query your database.
Copy this URL into Tableau's Web Data Connector input:
https://t.blockspring.com/bs/query-postgres
Finish the setup steps to use Query a Postgres DB in Tableau.
Finish the setup steps to use Query a Postgres DB in Slack.
Run this function with a POST request to Blockspring.
Visit the node.js quickstart to get started fast.
Visit the php quickstart to get started fast.
Visit the python quickstart to get started fast.
Visit the ruby quickstart to get started fast.
Visit the r quickstart to get started fast.
Visit the javascript quickstart to get started fast.
Use this URL for webhooks. You'll want to make a POST request.
curl -H "Content-Type: application/json" -d "{ \"db_query\": , \"no_headers\": false, \"join\": false, \"database_url\": }" "https://run.blockspring.com/api_v2/blocks/query-postgres?"
var blockspring = require("blockspring");
blockspring.runParsed("query-postgres", { "db_query": , "no_headers": false, "join": false, database_url: }, function(res) {
console.log(res.params);
});
var request = require("request");
request.post({
url: "https://run.blockspring.com/api_v2/blocks/query-postgres?",
form: { "db_query": , "no_headers": false, "join": false, database_url: }
},
function(err, response, body) {
console.log(JSON.parse(body));
});
<?php
$url = 'https://run.blockspring.com/api_v2/blocks/query-postgres?';
$data = json_encode(array("db_query" => , "no_headers" => false, "join" => false, "database_url" => ));
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => array("Accept: application/json", "Content-Type: application/json"),
'method' => 'POST',
'content' => $data,
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump(json_decode($result));
?>
<?php
require('blockspring.php');
var_dump(Blockspring::runParsed("query-postgres", array("db_query" => , "no_headers" => false, "join" => false, "database_url" => ))->params);
import json
import urllib2
req = urllib2.Request("https://run.blockspring.com/api_v2/blocks/query-postgres?")
req.add_header('Content-Type', 'application/json')
data = { "db_query": , "no_headers": False, "join": False, "database_url": }
results = urllib2.urlopen(req, json.dumps(data)).read()
print json.loads(results)
import blockspring
import json
print blockspring.runParsed("query-postgres", { "db_query": , "no_headers": False, "join": False, "database_url": }).params
require 'rest_client'
response = RestClient.post 'https://run.blockspring.com/api_v2/blocks/query-postgres?', JSON.dump({ "db_query" => , "no_headers" => false, "join" => false, "database_url" => }), :content_type => :json
puts JSON.load(response)
require 'blockspring'
puts Blockspring.runParsed("query-postgres", { "db_query" => , "no_headers" => false, "join" => false, "database_url" => } ).params
require 'rest_client'
response = RestClient.post 'https://run.blockspring.com/api_v2/blocks/query-postgres?', JSON.dump({ "db_query" = , "no_headers" = FALSE, "join" = FALSE, "database_url" = }), :content_type => :json
puts JSON.load(response)
library('blockspring')
library('rjson')
print(blockspringRunParsed("query-postgres", list( "db_query" = , "no_headers" = FALSE, "join" = FALSE, "database_url" = ))$params)
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="https://cdn.blockspring.com/blockspring.js"></script>
<script>
blockspring.runParsed("query-postgres", { "db_query": , "no_headers": false, "join": false, database_url: }, { "api_key": "" }, function(res){
console.log(res.params);
})
</script>
https://run.blockspring.com/api_v2/blocks/query-postgres?
Finish the setup steps to use Query a Postgres DB in Code.