1.4.12 • Published 4 years ago

dm-aurora-rds v1.4.12

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Welcome to dm-aurora-rds 👋

Build Status NPM Package Maintainability Documentation Downloads/week lerna

A Data Migration driver to run queries on an Aurora RDS instance.

Configuration

Parameters

The Aurora RDS driver accepts the following parameters as part of its configuration:

NameTypeRequiredDescription
regionstringYesThe AWS Region where this table exists
resourceArnstringYesARN of the Aruora RDS cluster
secretArnstringYesARN of the secret manager secret to use for database credentials
databaseSchemastringNoThe database schema to connect to by default

Example

const CloudFormationProcessor = require("dm-processor-cf");

module.exports = {
  defaultStage: "prod",
  migrationDirectory: "migrations",
  stages: {
    prod: {
      defaultParams: {
        region: "us-east-1",
        stack: "some-stack-name",
      },
      drivers: {
        auroraDriver: {
          driver: require("dm-aurora-rds"),
          params: {
            databaseSchema: "some-schema",
            resourceArn: {
              processor: CloudFormationProcessor,
              params: {
                output: "AuroraArn",
              },
            },
            secretArn: {
              processor: CloudFormationProcessor,
              params: {
                output: "AuroraSecretArn",
              },
            },
          },
        },
      },
    },
  },
};

Methods

query

Executes a query against the database, returning a rxjs Observable

Arguments

NameDescription
queryThe query string to be executed
parametersAn array of AWS.RDSDataService.SqlParameters that will be used in the query
optionsA QueryOptions object

Example

import { toArray } from "rxjs/operators";

export default {
  async up(context: ScriptContext, log: Logger) {
    const aurora = await context.getDriver<RdsDriver>("auroraDriver");
    const someTableResults = await aurora
      .query<SomeDataType>(`SELECT * FROM some_table`)
      .pipe(toArray())
      .toPromise();
  },
};
1.4.12

4 years ago

1.4.11

4 years ago

1.4.10

4 years ago

1.4.9

4 years ago

1.4.8

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.18

4 years ago