I am building an application in Oracle Apex. The idea is to be a frontend to multiple databases, all of which have the same schema objects.
To do this, I would like to use Rest Enabled SQL to build out the pages I need, then somehow swap the database used for the actual data at run time. The basic idea looks a little like this:
DB1 ----+
|
DB2 ----+---> Rest Enabled SQL ---> Apex page
|
DB3 ----+
So at runtime, a user would be able to select between DB1, DB2 and DB3 as the source of the data for the page they are looking at.
What I am having difficulty with is how to associate the user's session with the requests to the Rest Enabled SQL end point. I have printed out the headers, and there is nothing that I can use that identifies the user session.
I would like to know if it is possible to do one of the following:
I have tried using the initialization code in the Rest Enabled SQL definition, but that only runs after the Api request has been sent.
I have managed to solve this by investigating the body of the request in my end point, and it contains the user ID the initiated the request, so I am able to switch on that based on some logic in the application.