Knex Data API Client
This is a fork of the knex-data-api-client by @alan-cooney to support both Postgres and Mysql
The Knex Aurora Data API Client is a Knex extension that supports the RDS Data API, built using Jeremy Daily's excellent data-api-client module.
Support for transactions, and nestTables is included.
The library uses the default AWS credentials to connect to the RDS database using the data-api. The data-api-client that this library is a using provides more documentation on the permissions required and how to enable the data-api for the database.
To use aurora in mysql mode:
const knexDataApiClient = require('knex-aurora-data-api-client');
const knex = require('knex')({
client: knexDataApiClient.mysql,
connection: {
secretArn: 'secret-arn', // Required
resourceArn: 'db-resource-arn', // Required
database: 'db-name',
region: 'eu-west-2',
},
});
To use aurora in postgres mode:
const knexDataApiClient = require('knex-aurora-data-api-client');
const knex = require('knex')({
client: knexDataApiClient.postgres,
connection: {
secretArn: 'secret-arn', // Required
resourceArn: 'db-resource-arn', // Required
database: 'db-name',
region: 'eu-west-2',
},
});
Note - this significantly increases the data required back from the RDS data api.
knex().doSomething().options({ nestTables: true });
Forked from Skyhook knex-data-api-client and provided under an MIT license.