Git Product home page Git Product logo

hasura-oracle-fdw's Introduction

Using oracle_fdw with Hasura Cloud and AWS RDS

Requirements

  • Hasura Cloud application
  • AWS RDS Postgres database
  • Oracle database

Instructions

  1. Connect the RDS Postgres to your Hasura Cloud application

  2. In your Postgres database, run the following commands to install the oracle_fdw extension and connect your Oracle database (filling in the correct connection string and credentials for your Oracle connection)

    • NOTE: You can do this via psql, the Hasura web console UI's "Run SQL" page, or any other database administration tool you prefer

CREATE EXTENSION oracle_fdw;

CREATE SERVER oradb
    FOREIGN DATA WRAPPER oracle_fdw
    OPTIONS (dbserver '//database-2.xxxxxxxx.us-east-1.rds.amazonaws.com:1521/mydb');

CREATE USER MAPPING FOR postgres
    SERVER oradb
    OPTIONS (user 'admin', password 'mypassword');
  1. For each table you would like to access through Hasura, use the CREATE FOREIGN TABLE() statement to wire up the foreign table connection. The below example creates a foreign table in Postgres called genre_oracle that maps to the remote table GENRE in the Oracle database:
CREATE FOREIGN TABLE genre_oracle (
    GenreId int NOT NULL,
    Name varchar(120)
)
    SERVER oradb
    OPTIONS (table 'GENRE');
  1. Make sure that the newly-created foreign tables you want to query from Hasura are "tracked"

  2. Now, all foreign tables created should be available for querying and insert/delete mutations. You can run a GraphQL query against the foreign table to test that it is working and returning the data you expect.

    • For example, using the table names given above, something like:
query {
    # Query "GENRE" table in Oracle
    genre_oracle {
        GenreId
        Name
    }
}

hasura-oracle-fdw's People

Contributors

gavinray97 avatar

Stargazers

Jonathan Hult avatar

Watchers

 avatar  avatar

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.