Frequently Asked Questions (FAQs)
Can DB2Rest handle multiple physical databases?
Yes DB2Rest can handle multiple physical databases.
Does DB2Rest provide an Open API specification?
Yes DB2Rest provides open API Specification. Which can also be used for Go, Python, Javascript. It can be found by browsing to the automatically provided /swagger-ui/
endpoint path such as http://127.0.0.1:8080/swagger-ui/index.html
Is there any SDK available for Python, GO, Javascript?
Currently, DB2Rest does not provide any client SDK for Python, GO, Javascript.
How can I handle same table/view names but in different databases?
The DB2Rest database user account has access to multiple databases and these databases have tables or views that have same names.
For example in a MySQL server 2 databases.
DB1
DB2
Both these databases have a table named users
.
So the schema looks like this
DB1.users
DB2.users
In this case there is name collision i.e if database/schema/catalog is not specified then the operation will fail. This can be resolved by specifying the schema/catalog as a header parameter.
- For
GET
use headerAccept-Profile
to specify schema.
Then two different tables can be queried.
GET /users HTTP/1.1
Accept-Profile: DB1
GET /users HTTP/1.1
Accept-Profile: DB2
- For
POST
use headerContent-Profile
to specify schema.
POST /users HTTP/1.1
Content-Profile: DB2
In case of a join, specify the schema of the root table using Accept-Profile
, where as schema for the other tables
can be specified directly as schemaName
attribute.
For further help, visit us on Discord or our GitHub Discussions