A command line tool to simplify the managment of DB objects and scripts in your project.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Many projects requires the usage of Stored Procedurs, Triggers, SQL Functions, Views, various scripts and Schema Checking/validations.
Rahl Commander (rcom) provides facilities and structure to manage all those pieces of code
used in your project.
rcom will do the following for you:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
assets
folder, right under APPDIR.bin
folder right under APPDIR/config/__init__.py
/config/ignore_list.py
(I assume you have Python and the necessary mysql connector).
Currently supporting only manual (very simple) installation.
autocompletion, functions, scripts, sp, triggers, views
ASSETS/sp
and create folder proddb
. Then go to folder ASSETS/triggers
and create folder proddb
.
So you end with ASSETS/sp/proddb
and ASSETS/sp/triggers
.
(Check the examle_assets structure, which is setup for DBs dhara and dhara_views).
test.py --all
under the BIN to see all is good.You Are Done!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Examples: CD to bin
build all elements python build.py --all
drop all elements -> THIS WILL DROP JUST THE OBJECTS WHO ARE IN A FILE. IF u need a full clean, run the cleaner tool python drop.py --all
build all stored procedures python build.py -s
drop all triggers in DB dhara python drop.py -t -ddhara
Clean all objects in all the databases in assets python cleaner.py --all
CREATE TABLE `rcom_sql_upgrades` (
`file_name` varchar(255) NOT NULL,
`execute_order` int(11) unsigned NOT NULL DEFAULT '1' COMMENT 'if file is prefixed with a number it goes here and determines execution order of sqls',
`time_runned` timestamp NULL DEFAULT NULL,
`execution_status` enum('pending_completion','failed','failed_in_test','completed','completed_in_test') NOT NULL DEFAULT 'pending_completion',
`error_message` varchar(2000) DEFAULT NULL,
PRIMARY KEY (`file_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE dbo.rcom_sql_upgrades (
file_name varchar(255) NOT NULL,
execute_order INT NOT NULL DEFAULT 1,
time_runned DATETIME NULL,
execution_status VARCHAR(20) NOT NULL CHECK (execution_status IN ('pending_completion','failed','failed_in_test','completed','completed_in_test')) DEFAULT 'pending_completion',
error_message varchar(2000) DEFAULT NULL,
PRIMARY KEY (file_name) WITH (IGNORE_DUP_KEY = ON)
)