APEX Offline for everyone thanks to a Low Code API with Plug-Ins
- Low Code API thanks to APEX Plug-Ins
- Data Synchronization
- Input SQL Query -> Data gets downloaded and synced back
- Changes get saved to local storage
- Changes get synced back to server
- Conflict detection and resolution possible with your own logic
- Super fast and able to handle lots of data amounts thanks to SQLite
- APEX >= 23.2
- Following HTTP Response Headers are required
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Current APEX Bug: setting headers in shared components does not work!
There is a setting in APEX to set these headers. There currently is a bug that results in these headers not being set on Plug-In files. So this solution currently does not work.
So you need to set these headers in your Webserver or Proxy.
- Here is an example on how to it with ORDS standalone (Example 5-3).
More info on the header requirement.
Go to the latest release and download the installation zip file. For the base installation you run the tables and package scripts. Afterwards import the plug-ins.
Read the Installation Guide
- Import Plug-Ins from release download into your app
- Watch this tutorial video
x. After you defined your storage, you have to define the DML logic in the package offline_data_sync_api.sync_row
:
case
when pi_sync_storage_id = 'ingredients' and pi_sync_storage_version = 1 then
recipe_offline_sync_api.sync_ingredients_v1 (
pi_json => l_json
, pi_change_type => l_change_type
, pi_change_date => l_change_date
, pi_updated_by => v('APP_USER')
, po_success => po_success
, po_sync_fail_reason => po_sync_fail_reason
, po_sync_device_pk => po_sync_device_pk
, po_snyc_db_pk => po_snyc_db_pk
);
- This is a proof of concept
- There is no warranty or support garantee
- I am working on this in my free time
- I am not responsible for any data loss or damage
- Only a small fraction of APEX features are supported
- You can't just make your existing APEX app offline capable with this. You have to build your app with this in mind.
- The users could download the Database and get control over all offline available data
- The users could manipulate the data in the local database with malicious intent
Download SQLite WASM buidl from here