Managing Oracle APEX Application Source Code Using GitHub

Managing Oracle APEX Application Source Code Using GitHub

Managing Oracle APEX Application Source Code Using GitHub: Exporting APEX Applications and Database Objects

Introduction

Oracle APEX enables developers to build enterprise applications quickly with minimal coding. As applications grow, maintaining versions, tracking changes, and managing deployments becomes an important part of the development lifecycle.

An Oracle APEX application mainly consists of two components:

  • APEX Application Components
    • Pages
    • Regions
    • Items
    • Buttons
    • Processes
    • Dynamic Actions
    • Shared Components
  • Database Components
    • Tables
    • Views
    • Packages
    • Procedures
    • Functions
    • Triggers

Maintaining both components together helps developers migrate applications between different environments and maintain proper source control.

Why Use GitHub for Oracle APEX Projects?

GitHub provides version control capabilities that help Oracle APEX developers:

  • Track application changes
  • Maintain application versions
  • Collaborate with development teams
  • Maintain deployment scripts
  • Restore previous versions
  • Manage application releases

By storing APEX exports and database scripts together, the complete application source code can be maintained in one repository.

Repository Structure

A GitHub repository named APEX was created to maintain the Oracle APEX application source code.

The repository was organized with separate folders for the APEX application export and database objects.

APEX
│
├── README.md
│
├── application
│   └── sample_application.sql
│
├── database
│   ├── tables
│   │   ├── app_users.sql
│   │   ├── customers.sql
│   │   └── orders.sql
│   │
│   ├── views
│   │   └── customer_order_details.sql
│   │
│   ├── packages
│   │   └── app_security_pkg.sql
│   │
│   ├── procedures
│   │   └── proc_create_order.sql
│   │
│   ├── functions
│   │   └── fn_get_customer_balance.sql
│   │
│   └── triggers
│       └── trg_app_users.sql
│
└── scripts
    └── install.sql

Exporting Oracle APEX Application

The first step is exporting the Oracle APEX application.

Navigate to:

Application Builder
        |
        Application
        |
        Utilities
        |
        Export

Select:

Export Type:
Application

The exported SQL file contains:

  • Application metadata
  • Pages
  • Regions
  • Items
  • Buttons
  • Dynamic Actions
  • Processes
  • Shared Components
  • LOVs
  • Security configurations

The exported application file was stored inside the application folder.

application
    |
    └── sample_application.sql

Creating Database Object Scripts

Along with the APEX application export, database objects were exported and maintained as individual SQL files.

Instead of maintaining all objects in one large SQL file, each object was separated. This provides easier maintenance, better readability, and simple deployment management.

Tables

database/tables/app_users.sql

database/tables/customers.sql

database/tables/orders.sql

Example:

CREATE TABLE CUSTOMERS
(
    CUSTOMER_ID NUMBER,
    CUSTOMER_NAME VARCHAR2(100),
    EMAIL VARCHAR2(100),
    CREATED_DATE DATE
);

Views

database/views/customer_order_details.sql

Packages

database/packages/app_security_pkg.sql

Procedures

database/procedures/proc_create_order.sql

Example:

CREATE OR REPLACE PROCEDURE proc_create_order
(
    p_customer_id NUMBER,
    p_amount NUMBER
)
IS
BEGIN

    INSERT INTO orders
    (
        customer_id,
        amount,
        created_date
    )
    VALUES
    (
        p_customer_id,
        p_amount,
        SYSDATE
    );

END;
/

Functions

database/functions/fn_get_customer_balance.sql

Triggers

database/triggers/trg_app_users.sql

Creating Deployment Script

A master installation script can be created to execute all required files in the correct sequence.

scripts/install.sql
@../database/tables/app_users.sql
@../database/tables/customers.sql
@../database/tables/orders.sql

@../database/packages/app_security_pkg.sql

@../database/procedures/proc_create_order.sql

@../application/sample_application.sql

This helps install the complete application easily in another environment.

Git Branch Management

A separate branch was created to manage development changes.

main
 |
 └── develop
       |
       ├── feature/customer-module
       ├── feature/order-management
       └── bugfix/application-issues

The develop branch contains the latest development version of the Oracle APEX project.

Pushing Oracle APEX Project to GitHub

The workflow followed:

  1. Create GitHub repository
  2. Create Oracle APEX project folder structure
  3. Export APEX application
  4. Create database object scripts
  5. Add files into repository
  6. Create development branch
  7. Commit changes
  8. Push branch to GitHub

Benefits of This Approach

  • Better Collaboration: Developers can work on different modules while maintaining history.
  • Easy Deployment: Application export and database scripts are maintained together.
  • Change Tracking: All modifications are available through Git history.
  • Environment Migration: The same repository can be used for development, testing, and production.
  • Backup and Recovery: Previous versions can be restored whenever required.

Conclusion

Oracle APEX applications should follow proper source control practices similar to traditional software development.

By exporting the APEX application, maintaining database objects as individual SQL files, organizing a clean repository structure, and managing changes using Git branches, developers can create a reliable and maintainable deployment workflow.

Using GitHub with Oracle APEX brings modern development practices into the low-code application development ecosystem and helps teams build applications with better collaboration, version control, and deployment management.

Comments