Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

athena-client

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

athena-client

a nodejs simple aws athena client

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
decreased by-47.08%
Maintainers
1
Weekly downloads
 
Created
Source

athena-client - a nodejs simple aws athena client

Install with:

npm install athena-client

Usage Example

var credentials = {
    accessKeyId: 'xxxx',
    secretAccessKey: 'xxxx',
    region: 'xxxx',
}
var config = {
    bucketUri = 's3://bucketname'
}

var Athena = require("athena-client")
var client = Athena.client(credentials, config)

client.execute('SELECT 1', function(err, data)) {
    if (err) {
        return console.error(err)
    }
    console.log(data)
})

// You can also execute query with promises
client.execute('SELECT 1').then(function(data) {
    console.log(data)
}).catch(function(err) {
    console.error(err)
})

API

athena = require("athena-client")

This module exposes the Client method, which execute query to AWS Athena

client = athena.Client([credentials], [config])

Returns a client instance attached to the account specified by the given credentials and config.

The credentials can be specified as an object with accessKeyId and secretAccessKey and region members such as the following:

var credentials = {
    accessKeyId: 'xxxx',
    secretAccessKey: 'xxxx',
    region: 'xxxx',
}
config object properties
PropertyDefaultDescription
bucketUrlRequiredURI of s3 bucket
pollinInterval500Interval of polling sql results (ms)
queryTimeout0Timeout of query execution. 0 is no timeout
format'array'If 'array', the result of the query is as the following [ { _col0: '1' } , { _col0: '2' }] . If 'raw', the result of query is same with aws-sdk

client.execute([query], [options])

Returns query result. The options can be specified as an object with timeout and format members such as the following:

var options = {
    timeout: 3000,
    format: 'raw',
}

Keywords

FAQs

Package last updated on 13 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc