Created
August 28, 2017 18:26
-
-
Save codetricity/1b0b25cb1262fca91258afd2b5e7d59c to your computer and use it in GitHub Desktop.
MapD Tweetmap-2 database connector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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