Skip to content

Instantly share code, notes, and snippets.

@codetricity
Created August 28, 2017 18:26
Show Gist options
  • Save codetricity/1b0b25cb1262fca91258afd2b5e7d59c to your computer and use it in GitHub Desktop.
Save codetricity/1b0b25cb1262fca91258afd2b5e7d59c to your computer and use it in GitHub Desktop.
MapD Tweetmap-2 database connector
require("@mapd/connector/dist/browser-connector")
const Connector = window.MapdCon
const connection = new Connector()
.protocol("https")
.host("metis.mapd.com")
.port("443")
.dbName("mapd")
.user("mapd")
.password("HyperInteractive")
// log SQL queries
// connection.logging(true)
export function connect () {
return new Promise((resolve, reject) => connection.connect((error, result) => (error ? reject(error) : resolve(result))))
}
export function getConnection () {
return connection
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment