Integration with Postgres¶
In this topic, you'll learn how to effectively consume the 'Product360' Data Product through Postgres after confirming that it meets your use case requirements. This guide provides step-by-step instructions to help you connect and query the Data Product seamlessly.
Prerequisites¶
To maximize your learning experience, ensure you have the following in place:
- An established connection with Postgres.
- PSQL client installation.
Steps to consume Data Products¶
Follow the below steps to consume the Data Product via Postgres.
1. Access the Postgres section¶
Navigate to the Access Options tab of your Data Product (Product360) and select the Postgres section.
In the connection details section, you’ll be provided with the host address, port name, database details, username, and the password. Your DataOS API key is the password, you can create the DataOS API key in the token section of the DataOS profile.
2. Copy the connection string¶
Copy the provided connection string.
3. Test the connection¶
In your terminal, paste the copied coonection string and press enter, when prompt for the password provide your DataOS API key.
psql -h tcp.splendid-shrew.dataos.app -p 6432 -U iamgroot -d lens:public:cross-sell-affinity
Password for user iamgroot:
4. Ready to query¶
Once connected, you're ready to execute queries. For example, you can run the following command to retrieve data:
lens:public:cross-sell-affinity=> write your query here
# example
lens:public:cross-sell-affinity=> select * from cross_sell_opportunity_score limit 10
Next step¶
If you want to consume the Data Product via GraphQL, refer to the next topic.