Skip to main content

AWS Redshift to Google Sheets

Read rows from AWS Redshift table using them to insert rows into Google Sheets table

Clone the recipe by yourself to a YepCode account

Clone to YepCode

... or ask us for help to build the full solution

Ask our team for help
Share

Read rows from AWS Redshift table

Used integrations:
class AwsRedshiftSourceSelect {    async init() {        // TODO: Create your aws-redshift credential        // More info at https://docs.yepcode.io/integrations/aws-redshift/#credential-configuration        this.awsRedshift = yepcode.integration.awsRedshift(            "your-aws-redshift-credential-name"        );        // TODO: Customize the command to be executed        // More info at https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-data/interfaces/executestatementcommandinput.html        const {            Id        } = await this.awsRedshift.send(            new ExecuteStatementCommand({                ClusterIdentifier: "your-cluster-identifier",                Database: "your-database-name",                DbUser: "your-database-user",                Sql: "SELECT * FROM your-table-name;",            })        );        this.statementId = Id;        await this._awaitStatementToFinish();    }    async fetch(publish, done) {        let nextToken;        // if result is returned paginated, iterate to publish entire statement result        do {            const result = await this.awsRedshift.send(                new GetStatementResultCommand({                    Id: this.statementId,                    NextToken: nextToken,                })            );            nextToken = result.NextToken;            for (const record of result.Records) {                // Each record come as a list of record cells                // More info at https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-data/interfaces/getstatementresultcommandoutput.html                // TODO: Customize record columns mapping to the item that will be published                const item = {                    id: record.id,                    ...record                };                await publish(item);            }        } while (nextToken);        done();    }    async close() {}    _awaitStatementToFinish() {        return new Promise((resolve, reject) => {            const describeStatementCommand = new DescribeStatementCommand({                Id: this.statementId,            });            // Configure interval to check statement status            const intervalId = setInterval(async () => {                const result = await this.awsRedshift.send(describeStatementCommand);                if (result.Status === "FINISHED") {                    clearInterval(intervalId);                    resolve();                    return;                }                if (result.Status === "FAILED" || result.Status === "ABORTED") {                    clearInterval(intervalId);                    reject();                    return;                }            }, 1000);        });    }}

Insert rows into Google Sheets table

Used integrations:
class GoogleSpreadsheetTargetCreateSheet {    async init() {        // TODO: Create your google-spreadsheet credential        // More info at https://docs.yepcode.io/integrations/google-spreadsheet/#credential-configuration        const doc = await yepcode.integration.googleSpreadsheet(            "your-google-spreadsheet-credential-name"        );        // TODO: customize your sheet title and header values        this.sheet = await doc.addSheet({            title: "your-sheet-title",            headerValues: ["id", "name"],        });    }    async consume(item) {        // TODO: Customize the content of each row with your item content        return this.sheet.addRow({            id: item.id,            name: item.name,        }, {            insert: true,        });    }    async close() {}}

Find related recipes

  • AWS Redshift
  • Google Spreadsheet

FAQs

These recipes are a good starting point for you to build your own YepCode processes and solve your integration and automation problems.

YepCode is a SaaS platform that allows to create, execute and monitor integrations and automations using source code in a serverless environment.

We like to call it the Zapier for developers, since we bring all the agility and benefits of NoCode tools (avoid server provisioning, environment configuration, deployments,...), but with all the power of being able to use a programming language like JavaScript with a NodeJS engine.

You only have to fill the sign up form and your account will be created with our FREE plan (no credit card required).

YepCode has been created with a clear enterprise approach (multi-tenant environment, team management, high security and auditing standards, IdP integrations, on-premise options,...) so we can be the Swiss army knife of any team of engineering, especially those that need to extract or send information to external systems, and where a certain dynamism or adaptation to change is necessary in that process.

Sure! You just need to do some configuration to allow YepCode servers to connect to that service. Check our docs page to get more information.

Ask us for help to solve your integration problem

Recipes may be used in a self service approach cloning them to one YepCode account, but if you are looking for a turnkey approach, our team may help you.