Can I call Databases on a Deployed API using Python?

Connor
Level 1
Can I call Databases on a Deployed API using Python?

I have several databases that I'd like to access from an API I'm deploying. The databases are stored in the following postgres table:

api-node-referenced-data

I currently have many different SQL queries that are used to access the tables, but I'd like to change them all to a parameterised query in Python to avoid repeated manual work. However, I can't find any documentation on this topic.

Is it possible to use Python to access the postgres SQL database from a deployed API?

0 Kudos
1 Reply
Turribeach

I am not sure what you mean by โ€œdatabases stored on Postgres tablesโ€. In Postgres you can have databases and these databases can have tables which store data. 

With regards to connecting to Postgres from a deployed API in the API node this can certainly be done. There are several ways to do this so it will depend on how you want to architecture it:

  1. You could use the Dataiku API to connect back to your Automation node and read the datasets using the Dataiku API
  2. You could add the Dataiku connection to the API node and connect directly from the API node using Dataiku Python methods
  3. You could install the relevant Python packages in your Python code environment and connect directly from the API node using pure Python methods 

 

 

 

0 Kudos