I am the very model of modern meta generable
Export Oracle Data Modeler files as json and or SQL DDL for easier consumption by other processes.
- MODEL-CITIZEN
This tool was developed to feed downstream continuous integration processes (like join-hero) using objects modeled by the graphical tool Oracle SQL Developer Data Modeler. It was created to support version 18.2 of Oracle SQL Developer Data Modeler and Oracle Database 12c export type, primarily focused on tables, indexes and foreign keys. Your milage may vary for other targets and Data Modeler versions.
Installing may require elevated privileges. If you want to run without installing, see Run Without Installing. The following commands that reference '.' should be executed from the same folder in which this README file can be found.
docker build -t model-citizen .
# Print version info
docker run model-citizen --version
See the official Docker documentation for more details. In particular, using volumes will be handy so the container can interact with the native filesystem.
# Mount local filesystem and use in the container
docker run -it -v 'Z:\MY_COOL_MODELS\JJJ_DataModel\JJJ:/mnt/mydatamodel' model-citizen -i /mnt/mydatamodel/ -o /mnt/mydatamodel/model-citizen-out.ddl
This application requires Perl to be installed and on your path. Active Perl is one alternative for installing a Perl interpreter.
If you have chocolatey installed, you can use the following command to install Active Perl.
choco install activeperl
cpanm is the easiest and most modern way to install. If you don't have cpanm on your path, check out Installing cpanm
Install directly from a github repository.
cpanm git://github.com/Acxiom/model-citizen.git
By default it will install the Master branch version. If you want another version, you can specify with the @
symbol after the URL.
# Install the current development build
cpanm git://github.com/Acxiom/model-citizen.git@develop
Video showing cpanm github install example.
If this code repo is in BitBucket / Stash / Gitlab etc, you can use the checkout url that you would normally use for git.
cpanm https://<YOUR_USER_HERE>@<REPO_HOST_HERE>/<PATH_TO_GIT_HERE>.git@<BRANCH_HERE / COMMIT_HASH_HERE>
If you've checkout out the repository or unpacked the release tarball, you can run the following from the folder containing this README:
# Install from the directory the README file is in after unpacking the tar.gz
cpanm .
https://metacpan.org/pod/App::cpanminus#INSTALLATION
cpan .
perl Build.PL
./Build clean # Clean up build files
./Build installdeps # Install any missing dependencies. May require superuser privs
./Build # After this step, you should have entry point(s) in .\blib\script
./Build test # Run tests for cromulency
./Build install # Add entry point(s) to your path. May require superuser privs
See https://metacpan.org/pod/Module::Build for more info on Module::Build
# *nix
perl Makefile.PL
make
make test
make install
# Activeperl
perl Makefile.PL
dmake.exe
dmake.exe test
dmake.exe install
If you don't want to or can't install dependencies via Build installdeps
, you can install them manually via your favorite management system.
The dependency list can be reviewed here.
cpan install Log::Log4perl (cpan)
ppm install Log-Log4perl (ActivePerl)
sudo apt install liblog-log4perl-perl (Ubuntu/Debian)
sudo yum install perl-Log-Log4perl (CentOS/RedHat)
Users have reporting issues installing certain modules on Windows platforms. If one or more libraries fail to load due to failing tests on Windows, consider installing with the force flag turned on:
cpan install -f Log::Log4perl
You can run the model-citizen app without installing by invoking it in the ./script
directory.
Note, you will have to install any missing dependencies manually. If you have locally downloaded libraries, you can add them to @INC
via the -I
flag when invoking the Perl interpreter. See the official perlrun documentation for more info.
perl -I '.\vendor' .\script\model-citizen --help
Print usage info
model-citizen --help
Load up data modeler files and generate a DDL SQL output file and a json output file
model-citizen --outputFileSQL ./scratch/model.sql --outputFileJSON ./scratch/model.json --modelFilepath C:\git\datamodels\MY_AWESOME_DATA_MODEL\
The json output is an array of documents describing the data model. These can be fed directly into mongoDB using a tool such as mongoimport using the --jsonArray option.
mongoimport.exe --db model-citizen --collection model --file "C:\git\model-citizen\scratch\model.json"
--host localhost:27017 -v --stopOnError --jsonArray;
Sample data models can be found here.
Note: These models may be an older format (v2.x or v3.x) and will yield better results if upgraded using a more recent version of the Data Modeler utility.
If you are interested in contributing to the project, please check out our Contributor's Guide.