How to use the graphql-relational-schema-transformer.DataApiParams function in graphql-relational-schema-transformer

To help you get started, we’ve selected a few graphql-relational-schema-transformer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-cli / packages / amplify-category-api / provider-utils / awscloudformation / service-walkthroughs / appSync-rds-walkthrough.js View on Github external
async function selectDatabase(context, inputs, clusterArn, secretArn, AWS) {
  // Database Name Question
  const DataApi = new AWS.RDSDataService();
  const params = new DataApiParams();
  params.secretArn = secretArn;
  params.resourceArn = clusterArn;
  params.sql = 'SHOW databases';

  spinner.start('Fetching Aurora Serverless cluster...');
  const dataApiResult = await DataApi.executeStatement(params).promise();

  // eslint-disable-next-line prefer-destructuring
  const records = dataApiResult.records;
  const databaseList = [];

  for (let i = 0; i < records.length; i += 1) {
    const recordValue = records[i][0].stringValue;
    // ignore the three meta tables that the cluster creates
    if (!['information_schema', 'performance_schema', 'mysql'].includes(recordValue)) {
      databaseList.push(recordValue);

graphql-relational-schema-transformer

An AppSync model transform that takes a relational database and turns that into a GraphQL API.

Apache-2.0
Latest version published 5 months ago

Package Health Score

89 / 100
Full package analysis