. . .

MySQL Module

Introduction

Being a concrete module of the JDBC meta module, the MySQL 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 MySQL module to our backend. This can be done using the Module Market in the Dashboard and should automaticly add the JDBC meta module.

Now we can start a new crawl by hovering over the added MySQL module and clicking Use. We now have to fill in the required options as follows:

HTTP request query parameter

Dashboard field name

Extended description

Example

url

Connection URL

Connecting String containing the URL to the database server as well as the database name

jdbc:mysql://example.com:3306/app_db

userName

DB user name

User name to be used for authentication against the database

mysqladmin

password

DB user password

Password to be used for authentication against the database

secret

proposedModuleName

crawled Module name (optional)

You can set the name that should be used for the crawled module.
If you leave it empty, the name will be a combination of "MySQL" + DB name.

CrawledProducts

reCrawl

TRUE to overwrite previous crawling

true - Overwrites previously crawled data if it existed

false - Throws an error if previously crawled data exists. This assures that you don't accidently overwrite data.

true

ignoreMandatoryRef

TRUE ignore errors on mandatory references

true - ignores errors on mandatory references

false - Throws an error if mandatory reference was contained

true

customerName

ApiOmat customer name

Our customer name that we use to log in at ApiOmat

apinaut

appName

App name

Name of the backend (formerly called app); please use the name provided in the configuration dialog box:

Your base URL is: http://<HOSTNAME>/yambas/rest/apps/%appName%

%appName% is the String we need

myfirstapp

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 can add our freshly created module to our backend. In the case of this example its name would be MySQLAppDb.

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.


We would finally call the REST endpoint using


cURL

cURL call
curl -X GET "http://[YOURHOST]/yambas/rest/modules/MySQL/myfirstapp/spec/crawler/?url=jdbc:mysql://example.com:3306/mysql_app&userName=mysqladmin&password=secret&reCrawl=false&customerName=apinaut&appName=myfirstapp" -u [CUSTOMEREMAIL]:[CUSTOMERPWD]

Limitations

This version doesn't support inserting or updating "year" values. Geometry column type support is limited.