This repository provides an example of how to use the Xray library to interact with a Amazon Redshift database in a Go application. The example demonstrates how to connect to the database, execute queries, retrieve table schemas, and generate SQL CREATE TABLE
statements.
Before you begin, ensure you have the following:
- Go installed on your machine.
- Create an aws account and create a redhsift instance using spinning up a cluster.
- Environment variable
DB_PASSWORD
set to your database password.
Start by creating a main.go
file in your Go project and add the provided example in main.go
code into it and checkout Integration.md for more info.
Once you have added the example code to your main.go file, execute the following commands in your terminal:
go mod tidy
go run main.go
That's it! You should now be able to inspect and execute queries in your Amazon Redshift database using Xray in your Go application.