Step-by-step DB Sync server-side app implementation
This guide outlines the step-by-step process for implementing a DB Sync server-side app,
detailing key stages such as planning, development, testing, and deployment to ensure a streamlined
and efficient setup.
Import the DB Sync API modules Import the necessary DB Sync API modules for DB Sync server-side app functionality.Initialize the DB Sync API Initialize the DB Sync API by calling the module's initialization function.Register the schema, app and user Register the database schema, application, and user by using the dbsync_srvapp.register_central_app_params()
function with a JSON schema file, application ID, and user ID as parameters. User auto-registration can be achieved with the dbsync_srvapp.auto_register_user()
function.Connect to the central database To connect to the central database, use the SQL instruction specifying the database source and user credentials, as GAS/SSO/GIP authentication does not apply to database user connections.File modifications in the change log This example demonstrates a programming pattern for registering data row changes in a central database, including initializing changes, handling inserts, updates, and deletes, and ensuring proper transaction management with error handling.Clean up the DB Sync API Release resources used by the DB Sync API before exiting the server-side application.