PostgreSQL Module
Introduction
Being a concrete module of the JDBC meta module, the PostgreSQL can be used to access relational SQL databases via the middleware.
This documentation will focus on the usage of this specific module. Please refer to the JDBC Module documentation for common matters.
Dashboard Example
In order to crawl a database, we need to add the PostgreSQL module to our backend. This can be done using the Module Market in the Dashboard and should automatically add the JDBC meta module.
Now we can start a new crawl by hovering over the added PostgreSQL module and clicking Use. We now have to fill in the required options as follows:
Field name |
Description |
Example |
Database URL |
Connecting String containing the URL to the database server as well as the database name |
jdbc:postgresql://example.com:5432/pgApp |
Schema name |
Name of the schema that shall be crawled; It might equal your user name or be a custom one |
app_data |
User name |
User name to be used for authentication |
appAdmin |
Password |
Password to be used for authentication |
secret |
Re-crawl |
Yes - Overwrites previously crawled data if it existed No - Throws an error if previously crawled data exists. This assures that you don't accidentally overwrite data. |
No |
This might take up to a few minutes depending on the size of our database. As soon as it is finished, a notification will be displayed and we add can our freshly created module to our backend. In the case of this example its name would be PostgreSQLPgAppAppData.
After this point, the following steps are identical with any other JDBC module. You can continue by checking the crawled module as described in de JDBC meta module documentation.
REST Example
A new crawl can also be initiated using the REST interface.
Doing so, the Rest parameter names will differ from the field names stated above:
Field name |
Rest parameter name |
Database URL |
url |
Schema name |
schemaName |
User name |
userName |
Password |
password |
Re-crawl |
reCrawl |
The argument reCrawl only accepts Boolean values.
In addition to these parameters we need
Rest parameter name |
Description |
Example |
customerName |
Our customer name that we use to log in at ApiOmat |
apinaut |
appName |
Name of the backend (formerly called app); please use the name provided in the configuration dialog box: Your base URL is: http://apiomat.org:8080/yambas/rest/apps/%appName% %appName% is the String we need |
myfirstapp |
We would call the REST endpoint using
curl -X GET
"http://[YOURHOST]/yambas/rest/modules/PostgreSQL/myfirstapp/spec/crawler/?url=jdbc:postgresql://example.com:5432/pgApp&schemaName=app_data&userName=appAdmin&password=secret&reCrawl=false&customerName=apinaut&appName=myfirstapp"
-u [CUSTOMEREMAIL]:[CUSTOMERPWD]