An instance of the client.
Parameters
opts
object Options to the constructor
Examples
const owl = require('little-owl')({
accessKeyId: 'MY-AWS-ID',
secretAccessKey: 'MY-AWS-SECRET'
})
Submit a query and waits until it returns.
Parameters
queryString
string SQL statementcallback
submitQueryCallback node callback (err, queryId)
Examples
owl.submitQuery('SELECT * from owls', (err, queryId) => {
if (!err) {
console.log(queryId); // prints the query id
}
});
Get results from a submitted query. The return object contains: results: the results are an array of rows, each row an array of strings. nextToken: if the number of results is larger than maxRows, use nextToken to return the next set of values
Parameters
queryId
string Id of queryopts
object? Optionscallback
getQueryResultCallback node callback (err, results)
Examples
owl.getQueryResults('x2x4gas-12qwsd-a809', (err, data) => {
if (!err) {
console.log(data.results); // results is an array of rows
console.log(data.nextToken); // data.nextToken is used for pagination
}
});
owl.getQueryResults('x2x4gas-12qwsd-a809', {nextToken: '91kaspejk13'}, (err, data) => {
if (!err) {
console.log(data.results); // results is an array of rows
}
});