Created
February 7, 2021 01:00
-
-
Save joelgarciajr84/026f42cdded95d497fc6295d5256546e to your computer and use it in GitHub Desktop.
Implementing lib presto-ts
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
import { Presto, PrestoQueryParams, PrestoResponse } from "presto-ts"; | |
const prestoStatusUpdate = (prestoNotification: PrestoResponse): PrestoResponse => { | |
console.log("NEW PRESTO QUERY STATUS") | |
console.log(prestoNotification) | |
return prestoNotification; | |
} | |
const errorPresto = (error: Error) => { | |
console.error(error) | |
return error | |
} | |
const requestParams: PrestoQueryParams = { | |
query: 'SELECT * FROM pedidos', | |
catalog: 'mysqldb', | |
schema: 'clientes', | |
source: 'test-presto', | |
user: 'root', | |
password:'xxx', | |
host: 'localhost', | |
port: 8080, | |
isBasicAuth:true, | |
checkStatusInterval: 1000, | |
updatesNotification: prestoStatusUpdate, | |
errorNotification: errorPresto | |
} | |
const goPresto = new Presto (requestParams).go() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment