Giter Site home page Giter Site logo

rdapp's Introduction

rdapp - Redshift Data API Postgres Proxy

Build Status Go Reference Go Report Card Latest release Buy me a lunch

Use your favourite postgres tools to query redshift via the redshift data api.

Table of contents

Architecture

Architecture

Installation

Using Homebrew

brew install kishaningithub/tap/rdapp

Using docker

pulling the image

docker pull ghcr.io/kishaningithub/rdapp:0.5.6

running the image in interactive mode (volume mounted aws folder for config)

docker run -it -v "${HOME}/.aws:/root/.aws" ghcr.io/kishaningithub/rdapp:0.5.6

Others

Head over to the releases page and download a binary for your platform

Examples

  • Ensure aws credentials are setup in your env. Refer aws cli configuration guide for more info.
  • Interactive mode - This loads an interactive view where you can pick and choose clusters to connect to
    • This mode requires permissions to list provisioned clusters, work groups, namespaces and secrets (we do not read secret values, only requires list permission to choose secret ARN).
rdapp --listen ":15432"
  • Normal Mode - Here you specify redshift connection config as cli args
    • For proxying redshift serverless run command
rdapp --listen ":15432" --database "<<db name>>" --workgroup-name "<<work group name>>" --secret-arn "<<secret arn>>"
  • For proxying redshift provisioned run command
rdapp --listen ":15432" --db-user <<db user>> --cluster-identifier "<<cluster identifier>>" --database "<<db name>>"
  • If you notice above other than --listen which is the address rdapp listens to all other parameters are exactly the same as aws cli's execute statement command this is intentional and will be maintained that way in the future. This also helps people who are currently using the cli to migrate to rdapp
  • Once the proxy is up, use your favorite postgres tool to interact with your redshift database, the tool will connect to the address specified in the --listen and connects to it. If the parameter is not given it defaults to :25432
    • My favourite pg tool being pgcli below is an example of using the same
pgcli -h localhost -p 15432

> select * from employee limit 1;
+-------+-----------+
| id    | name      |
|-------+-----------|
| 1     | john doe  |
+-------+-----------+
OK 1

Usage

$ rdapp -h
Use your favourite postgres tools to query redshift via redshift data api

Usage:
  rdapp [flags]

Flags:
      --cluster-identifier string
      --database string
      --db-user string
  -h, --help                        help for rdapp
      --listen string                (default ":25432")
      --secret-arn string
      --verbose                     verbose output
      --workgroup-name string

Contributing

See CONTRIBUTING.md

Thanks

Special thanks to @jeroenrinzema for creating psql-wire without which this project might not have been possible.

rdapp's People

Contributors

kishaningithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rdapp's Issues

Upgrade to go 1.20

  • Upgrade go version
  • Upgrade github actions to work with the version specified in go.mod

Ability to save run config so that we can start rdapp just by specifying the alias name

I see a need were we connect do redshift in different environments. I think when we are starting rdapp instead of specifying all the params (cluster identifier, workgroup name, db name, db user etc) we can just refer it by aliases

Current

rdapp --listen "127.0.0.1:15432" --database "<<db name>>" --workgroup-name "<<work group name>>" --secret-arn "<<secret arn>>"

Proposed

Saving the alias

Note the --save-alias below

rdapp --listen "127.0.0.1:15432" --database "<<db name>>" --workgroup-name "<<work group name>>" --secret-arn "<<secret arn>>" --save-alias "dev"

Using the alias

rdapp --listen "127.0.0.1:15432" --use-alias "dev"

Keeping this open for feedback by users on the API design and also on the feature itself

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.