Skip to content

Commit

Permalink
Add changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
aashikam committed Jan 19, 2024
1 parent e054c61 commit 9a2e84d
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 8 deletions.
5 changes: 5 additions & 0 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ The `ballerinax/aws.redshift` connector facilitates seamless integration with Am
To effectively utilize the Ballerina AWS Redshift connector, you must have an Amazon Redshift cluster. Follow these steps to create an AWS Redshift cluster.

### Step 1: Login to AWS Console

1. Begin by logging into the [AWS Management Console](https://aws.amazon.com/).

### Step 2: Navigate to Amazon Redshift and Create a Cluster

1. In the AWS Console, navigate to the Amazon Redshift service. Click on the "Create cluster" button to initiate the process of creating a new Amazon Redshift cluster.

<img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-aws.redshift/master/docs/setup/resources/create-cluster-1.png alt="Create cluster" width="50%">

<img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-aws.redshift/master/docs/setup/resources/create-cluster-2.png alt="Create cluster" width="50%">

### Step 3: Configure Cluster Settings

1. Follow the on-screen instructions to configure your Redshift cluster settings, including cluster identifier, database name, credentials, and other relevant parameters.

<img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-aws.redshift/master/docs/setup/resources/basic-configs.png alt="Basic configs" width="50%">
Expand All @@ -33,6 +36,7 @@ To effectively utilize the Ballerina AWS Redshift connector, you must have an Am
4. Finally, review your configuration settings, and once satisfied, click "Create cluster" to launch your Amazon Redshift cluster.

### Step 4: Wait for Cluster Availability

1. It may take some time for your Redshift cluster to be available. Monitor the cluster status in the AWS Console until it shows as "Available".

<img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-aws.redshift/master/docs/setup/resources/availability.png alt="Availability" width="50%">
Expand Down Expand Up @@ -84,6 +88,7 @@ check from record {} result in resultStream
```

#### Insert data into the database

```ballerina
sql:ParameterizedQuery sqlQuery = `INSERT INTO your_table_name (firstname, lastname, state, email, username)
VALUES ('Cody', 'Moss', 'ON', 'dolor.nonummy@ipsumdolorsit.ca', 'WWZ18EOX');`;
Expand Down
6 changes: 0 additions & 6 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

The `ballerinax/aws.redshift` connector facilitates seamless integration with Amazon Redshift, offering Ballerina users a convenient and expressive way to connect, query, and interact with Redshift clusters.

## Compatibility
| | Version |
|-------------------------------|--------------------------------------|
| Ballerina Language | Ballerina Swan Lake 2201.8.0 |
| Ballerina AWS Redshift Driver | ballerinax/aws.redshift.driver:0.1.0 |

## Set up guide

To effectively utilize the Ballerina AWS Redshift connector, you must have an Amazon Redshift cluster. Follow these steps to create an AWS Redshift cluster.
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

The `ballerinax/aws.redshift` connector facilitates seamless integration with Amazon Redshift, offering Ballerina users a convenient and expressive way to connect, query, and interact with Redshift clusters.

1. [Read data from the database](https://github.com/ballerina-platform/module-ballerinax-aws.redshift/blob/main/examples/query.bal) - Connects to AWS Redshift using the Redshift connector and performs a simple SQL query to select all records from a specified table with a limit of 10.
1. [Read data from the database](https://github.com/ballerina-platform/module-ballerinax-aws.redshift/blob/main/examples/query) - Connects to AWS Redshift using the Redshift connector and performs a simple SQL query to select all records from a specified table with a limit of 10.

2. [Insert data in to the database](https://github.com/ballerina-platform/module-ballerinax-aws.redshift/blob/main/examples/execute.bal) - Connects to AWS Redshift using the Redshift connector and performs an INSERT operation into a specified table
2. [Insert data in to the database](https://github.com/ballerina-platform/module-ballerinax-aws.redshift/blob/main/examples/execute) - Connects to AWS Redshift using the Redshift connector and performs an INSERT operation into a specified table

## Prerequisites

Expand Down
8 changes: 8 additions & 0 deletions examples/execute/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
org = "sample"
name = "execute"
version = "0.1.0"
distribution = "2201.8.2"

[build-options]
observabilityIncluded = true
File renamed without changes.
28 changes: 28 additions & 0 deletions examples/execute/execute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Execute function

Connects to AWS Redshift using the Redshift connector and performs an INSERT operation into a specified table.

## Prerequisites

### 1. Set up

Refer to the set up guide in [ReadMe](../../../README.md) for necessary credentials.

### 2. Configuration

Configure AWS Redshift API credent ials in Config.toml in the example directory:

```toml
jdbcUrl="<JDBC URL of the created Redshift cluster>"
user="<Username>"
password="<Password>"
```


## Run the Example

Execute the following command to run the example:

```bash
bal run
```
8 changes: 8 additions & 0 deletions examples/query/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
org = "sample"
name = "query"
version = "0.1.0"
distribution = "2201.8.2"

[build-options]
observabilityIncluded = true
File renamed without changes.
28 changes: 28 additions & 0 deletions examples/query/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Query function

Connects to AWS Redshift using the Redshift connector and performs a simple SQL query to select all records from a specified table with a limit of 10.

## Prerequisites

### 1. Set up

Refer to the set up guide in [ReadMe](../../../README.md) for necessary credentials.

### 2. Configuration

Configure AWS Redshift API credentials in Config.toml in the example directory:

```toml
jdbcUrl="<JDBC URL of the created Redshift cluster>"
user="<Username>"
password="<Password>"
```


## Run the Example

Execute the following command to run the example:

```bash
bal run
```

0 comments on commit 9a2e84d

Please sign in to comment.