oracle-export-ddl
v0.1.0
Published
A specialized CLI tool to export Oracle procedural objects (Packages, Procedures, Functions, Types, and Triggers) from the `USER_SOURCE` data dictionary view into individual, version-controllable physical files.
Downloads
93
Readme
oracle-export-ddl
A specialized CLI tool to export Oracle procedural objects (Packages, Procedures, Functions, Types, and Triggers) from the USER_SOURCE data dictionary view into individual, version-controllable physical files.
Features
- Object Support: Exports
PACKAGE,PACKAGE BODY,PROCEDURE,FUNCTION,TYPE,TYPE BODY,JAVA SOURCE, andTRIGGER. - Smart Extensions: Automatically maps Oracle object types to standard file extensions (
.pks,.pkb,.prc,.fnc, etc.). - SQL*Plus Compatible: Wraps exported source code with
CREATE OR REPLACEand the/terminator. - Filtering: Filter by object type or specific object name.
- Modern Stack: Built with TypeScript, Node.js 22+, and
node-oracledb.
Installation
npm install -g oracle-export-ddlUsage
oracle-export-ddl --username MY_USER --password MY_PASSWORD --connection localhost:1521/XEPDB1 --directory ./src/dbOptions
--connection <string>: Oracle connection string (Default:127.0.0.1:1521/TESTorORACLE_SERVERenv var).--username <string>: Oracle username (Required orORACLE_USERenv var).--password <string>: Oracle password (Required orORACLE_PASSWORDenv var).--directory <string>: Output directory (Default:./output).--type <string>: Filter by object type (e.g.,PACKAGE,PROCEDURE).--name <string>: Filter by object name (e.g.,MY_COOL_PROCEDURE).
Environment Variables
The tool can also be configured using environment variables:
ORACLE_SERVER: Database connection string.ORACLE_USER: Database username.ORACLE_PASSWORD: Database password.
Development
See AGENTS.md for detailed development guidelines, code style, and testing instructions.
Quick Start
npm installnpm run buildnpm run test
License
MIT © Dieter Oberkofler
