core is an Oracle PL/SQL framework for database application deployment, versioning, dependency management, and lifecycle tracking.
It provides infrastructure for building composable, semantically-versioned database applications with deployment provenance, metadata ownership, dependency tracking, and operational tooling.
pkg_application- application registration
- semantic version tracking
- deployment lifecycle management
- dependency management
- object registration
- deployment provenance tracking via git commit hash
- uninstall and cleanup support
-
pkg_syslog- generic logging utility inspired by UNIX syslog
-
pkg_trace- lightweight tracing facility for runtime diagnostics and troubleshooting
pkg_app_dict- generic application dictionary framework
-
assert- design-by-contract style assertion procedure
-
num_tab- reusable numeric collection type for passing arrays of numbers
Applications are deployed using semantic version metadata:
- major
- minor
- patch
- pre-release
- build metadata
This allows database applications to evolve in a controlled and traceable way.
Deployments may optionally record the full 40-character git commit hash associated with the deployed source state.
This allows environments running the same semantic version to still be distinguished during active development, hotfixes, or unreleased builds.
Applications can declare dependencies on:
- other applications
- required system privileges
- required database objects
This helps validate deployment prerequisites and application compatibility.
Applications may register ownership of rows stored in tables owned by other applications, enabling automatic cleanup during uninstall.
BEGIN
pkg_application.begin_deployment_p(
ip_application_name => 'MYAPP',
ip_major_version => 1,
ip_minor_version => 0,
ip_patch_version => 0,
ip_pre_release => 'beta.1',
ip_deploy_commit_hash => 'a1b2c3d4e5f6789012345678901234567890abcd',
ip_notes => 'Initial deployment of MYAPP'
);
END;
/Applications may then:
- register deployed objects
- register dependencies
- seed metadata
- mark the deployment complete
Deployment manifests may receive the full 40-character git commit hash associated with the application source being deployed.
One common workflow is:
- Generate an
env.sqlfile containing SQL*Plus substitution variables for each application/repository. - Load
env.sqlfrom the top-level deployment wrapper. - Pass the appropriate commit hash into each application deployment manifest.
- Store that hash using
pkg_application.begin_deployment_p.
Example generated env.sql:
DEFINE CORE = 22058236147ab4a644e68faee4e28f176580a26a
DEFINE UTL_METADATA_SCRIPT = 08aa01ccac28672208c012cc0b13bae6a91b778bExample wrapper usage:
@./env.sql
--example only - core should be installed first
@../core/Deployment_Manifests/deploy.core.full.sql &CORE
@../utl_metadata_script/Deployment_Manifests/deploy.full.sql &UTL_METADATA_SCRIPTThis allows the deployment registry to track not only which semantic version of an application is installed, but the exact source commit that produced the deployed database objects.
This repository includes:
Deployment_Manifests/uninstall.core.sql
a self-contained uninstall script for the core deployment.
- It drops the objects created by
deploy.core.full.sql - It does not rely on
APP_OBJECTSorpkg_applicationmetadata being populated - It prompts for confirmation before proceeding
Warning
uninstall.core.sql is destructive and intended only for safe,
non-production environments.
A key feature of pkg_application is the ability to register metadata
that belongs to one application but lives in a table owned by another.
This ensures automatic cleanup when delete_application_p is called,
with no orphaned rows left behind.
Applications frequently seed rows into shared tables owned by other applications.
For example:
MYAPPinserts rows intoapp_dictionaryapp_dictionaryis owned bycore
Without ownership tracking, those rows become orphaned when MYAPP
is later removed.
add_object_metadata_p records:
- the target table name
- a discriminator column
- a discriminator value
Together, these identify the rows owned by the registering application.
When delete_application_p is called, core loops through all
registered metadata and executes:
DELETE FROM <table>
WHERE <discriminator_col> = <discriminator_val>;-- MYAPP deployment: seed reference data into another app's table
INSERT INTO product_category (
owning_app,
category_code,
description
)
VALUES (
'MYAPP',
'WIDGET',
'Widget category'
);
-- Register those rows for automatic cleanup
EXEC pkg_application.add_object_metadata_p(
ip_application_name => 'MYAPP',
ip_object_name => 'PRODUCT_CATEGORY',
ip_object_type => pkg_application.c_object_type_table,
ip_discriminator_col => 'OWNING_APP',
ip_discriminator_val => 'MYAPP');
-- Later: removing MYAPP automatically deletes its rows
EXEC pkg_application.delete_application_p(
ip_application_name => 'MYAPP');When a plain DELETE is not sufficient — for example, when an
application creates dynamic database objects such as:
- queues
- sequences
- subsidiary tables
keyed by a discriminator value, the ip_dml_override_proc
parameter names a procedure to call instead of the default DELETE.
The procedure is invoked as:
BEGIN <proc_name>; END;and is responsible for all cleanup.
-- MYAPP creates a private queue at deploy time
EXEC pkg_application.add_object_metadata_p(
ip_application_name => 'MYAPP',
ip_object_name => 'APP_OBJECTS',
ip_object_type => pkg_application.c_object_type_table,
ip_discriminator_col => 'APPLICATION_NAME',
ip_discriminator_val => 'MYAPP',
ip_dml_override_proc => 'myapp_cleanup.drop_private_queue_p');Planned future capabilities include:
- transport-style deployment orchestration
- environment promotion workflows
- deployment validation
- automated dependency resolution
- CI/CD integration
- richer metadata introspection
Currently developed and tested against Oracle Database 19c.
This project is under active development and APIs may evolve.
Licensed under the Apache License, Version 2.0.
See the LICENSE file for details.