dbsync_app: Client app module

Table 1. DB Sync client app module (dbsync_app.4gl)
Function Description
FUNCTION apply_data_changes(
      ret_evts dbsync_core.t_dbsync_event_array
  )
  RETURNS INTEGER
Applies changes comming from the server into local client database.
FUNCTION cleanup() RETURNS INTEGER
Terminate module usage.
FUNCTION collect_local_changes() RETURNS INTEGER
Collect local changes.
FUNCTION collect_local_pkeys() RETURNS INTEGER
Collect local primary keys for a set of tables.
FUNCTION compact_local_changes(
      tabname STRING
  )
  RETURNS INTEGER
Compact local registered changes.
FUNCTION data_reset() RETURNS INTEGER
DB Sync synchronization reset procedure.
FUNCTION data_sync(
      return_receipt BOOLEAN
  )
  RETURNS INTEGER
DB Sync synchronization procedure collecting local changes.
FUNCTION data_sync_init()
Initialize DB Sync synchronization procedure.
FUNCTION data_sync_retrieve()
Append a retrieve event for the registered tables to the sync procedure.
FUNCTION data_sync_send() RETURNS INTEGER
Send the synchronization procedure to the server.
FUNCTION data_sync_set_full_sync(
      full_sync BOOLEAN
  )
Sets the 'full sync' option for DB Sync synchronization.
FUNCTION data_sync_set_return_receipt(
      return_receipt BOOLEAN
  )
Sets the 'return receipt' option for DB Sync synchronization.
FUNCTION get_database_copy(
      with_data BOOLEAN,
      local_dbf STRING
  )
  RETURNS INTEGER
Make a copy of the database for the current user/app.
FUNCTION get_app_tables(
      tabinfo dbsync_core.t_tabinfo
  )
  RETURNS INTEGER
Fetch the list of tables assigned to the current app.
FUNCTION get_result_status( )
  RETURNS STRING
Returns the status of the last synchronization operation.
Returns the result events from the last sync procedure.
FUNCTION initialize()
DB Sync client app lib initialization.
FUNCTION is_row_referenced(
      table_name STRING,
      jo_data util.JSONObject
  )
  RETURNS BOOLEAN
Checks if a given row is still referenced in other tables by foreign key.
FUNCTION new_temp_autoincr(
      tabname STRING,
  )
  RETURNS BIGINT
Get a new local temp auto-incremented identifier.
Registers the dbsync source record for the remote app.
Registers the dbsync user identification for the remote app.
FUNCTION register_local_change(
      tabname STRING,
      columns DYNAMIC ARRAY OF STRING,
      pkeyval BIGINT
  )
  RETURNS INTEGER
Register dbsync change for some fields of a given local row.
FUNCTION register_local_change_cpk2(
      tabname STRING,
      columns DYNAMIC ARRAY OF STRING,
      pkeyval_1 BIGINT,
      pkeyval_2 BIGINT
  )
  RETURNS INTEGER
Register dbsync change for a given local row with a 2-col integer pkey.
FUNCTION register_local_change_cpk3_s(
      tabname STRING,
      columns DYNAMIC ARRAY OF STRING,
      pkeyval_1 STRING,
      pkeyval_2 STRING,
      pkeyval_3 STRING
  )
  RETURNS INTEGER
Register dbsync change for a given local row with a composite pkey.
FUNCTION register_local_change_s(
      tabname STRING,
      columns DYNAMIC ARRAY OF STRING,
      pkeyval STRING
  )
  RETURNS INTEGER
Same as register_local_change() but with string column.
FUNCTION register_local_dbschema(
      schema_filename STRING,
  )
Loads the dbsync schema for the remote app.
FUNCTION register_local_delete(
      tabname STRING,
      pkeyval BIGINT
  )
  RETURNS INTEGER
Register dbsync delete for a given local row.
FUNCTION register_local_delete_cpk2(
      tabname STRING,
      pkeyval_1 BIGINT,
      pkeyval_2 BIGINT
  )
  RETURNS INTEGER
Register dbsync delete for a given local row with a 2-col integer pkey.
FUNCTION register_local_delete_cpk3_s(
      tabname STRING,
      pkeyval_1 STRING,
      pkeyval_2 STRING,
      pkeyval_3 STRING
  )
  RETURNS INTEGER
Register dbsync delete for a given local row with a composite pkey.
FUNCTION register_local_delete_s(
      tabname STRING,
      pkeyval STRING
  )
  RETURNS INTEGER
Same as register_local_delete() but with string column.
FUNCTION register_local_insert(
      tabname STRING,
      pkeyval BIGINT
  )
  RETURNS INTEGER
Register dbsync insert for a given local row.
FUNCTION register_local_insert_cpk2(
      tabname STRING,
      pkeyval_1 BIGINT,
      pkeyval_2 BIGINT
  )
  RETURNS INTEGER
Register dbsync insert for a given local row with a 2-col integer pkey.
FUNCTION register_local_insert_cpk3_s(
      tabname STRING,
      pkeyval_1 STRING,
      pkeyval_2 STRING,
      pkeyval_3 STRING
  )
  RETURNS INTEGER
Register dbsync insert for a given local row with a composite pkey.
FUNCTION register_local_insert_s(
      tabname STRING,
      pkeyval STRING
  )
  RETURNS INTEGER
Same as register_local_insert() but with string column.
Initializes local changes registration.
FUNCTION register_local_update(
      tabname STRING,
      pkeyval BIGINT
  )
  RETURNS INTEGER
Register dbsync update for a given local row.
FUNCTION register_local_update_cpk2(
      tabname STRING,
      pkeyval_1 BIGINT,
      pkeyval_2 BIGINT
  )
  RETURNS INTEGER
Register dbsync update for a given local row with a 2-col integer pkey.
FUNCTIONregister_local_update_cpk3_s(
      tabname STRING,
      pkeyval_1 STRING,
      pkeyval_2 STRING,
      pkeyval_3 STRING
  )
  RETURNS INTEGER
Register dbsync update for a given local row with a composite pkey.
FUNCTION register_local_update_s(
      tabname STRING,
      pkeyval STRING
  )
  RETURNS INTEGER
Same as register_local_update() but with string column.
FUNCTION send_return_receipt(
      rr_commit BOOLEAN
  )
  RETURNS INTEGER
Send a return receipt for the registered tables.