HHS / simpler-grants-gov

https://simpler.grants.gov
Other
41 stars 11 forks source link

[Task]: Create foreign data wrapper and test data access through it #1267

Closed coilysiren closed 7 months ago

coilysiren commented 7 months ago

Summary

CREATE EXTENSION oracle_fdw;
CREATE SERVER grants FOREIGN DATA WRAPPER oracle_fdw OPTIONS (dbserver '//HOST:PORT/DATABASE');

Fill in HOST, PORT, DATABASE

CREATE USER MAPPING FOR ROLE SERVER grants OPTIONS (user 'USER', password 'PASSWORD');
GRANT USAGE ON FOREIGN SERVER grants TO ROLE;
GRANT USAGE ON FOREIGN DATA WRAPPER oracle_fdw TO ROLE;

Fill in ROLE, USER, PASSWORD

CREATE FOREIGN TABLE api.foreign_topportunity (...TABLE SCHEMA...) SERVER grants OPTIONS (schema 'EGRANTSADMIN', table 'TOPPORTUNITY');
GRANT ALL ON api.foreign_topportunity to ROLE;

Fill in ...TABLE SCHEMA...

See also slack: https://betagrantsgov.slack.com/archives/C05UJJNKN3B/p1708019321304029

And docs: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Extensions.foreign-data-wrappers.html#postgresql-oracle-fdw

Acceptance criteria

coilysiren commented 7 months ago

Using the RDS query editor to run these commands now

sumiat commented 7 months ago

separate ticket for FDW tested in prod will be created

coilysiren commented 7 months ago

PROD ticket => https://github.com/HHS/simpler-grants-gov/issues/1281