knex-dialect-athena
v0.0.12
Published
A Knex dialect for AWS Athena
Downloads
1,101
Readme
knex-dialect-athena
A Knex dialect for AWS Athena.
Installation
Using your favorite package manager, install knex-dialect-athena
, along with its peer dependencies (if you don't already have them installed):
npm install knex-dialect-athena knex @aws-sdk/client-athena
Usage
This package exports the createAthenaDialect
function, the result of which can be passed to knex
's client
option:
import Knex from "knex";
import { createAthenaDialect } from "knex-dialect-athena";
const knex = Knex({
client: createAthenaDialect({
database: "my-database-name",
outputLocation: "s3://my/output/location",
// Additional `AthenaClient` options can go here:
// region: "..."
}),
});
interface User {
id: number;
name: string;
age: number;
}
// Retrieves the data from the provided Athena database
const user = await knex<User>("users").where("id", 1).first();