RAHL COMMANDER for SQL
A command line tool to simplify the managment of DB objects and scripts in your project.
- Python >= 3.3
- Python mysql.connector
- Mysql >= 5.1
Currently supports objects for
Currently supports auto completion for
- PHP + Eclipse
Many projects requires the usage of Stored Procedurs, Triggers, SQL Functions, Views
and various scripts.
Rahl Commander (RCom)provides facilities and structure to manage all those pieces of code used in your project, but are not part of the main code base.
RCom will do the following for you:
- Build for you all or some of the objects into the DB of your choice.
- Will generate auto completion files for your IDE (how nice it is to get auto completion for a stored procedure in your PHP, heh?).
- Will give easy cleanup of the DB of all or some objects (Great for use in release scritps).
- Provide a simple cleanup tool of the code. You write a nice Stored Procedure. All indented and commented. But, when u copy it and try to run it through the command line, it craps out. All due to white space characters in the wrong place. RCom will generate a clean version for you to copy paste into the command line.
- APPDIR is where you checked out Rahl Commander.
- ASSETS is the
assetsfolder, right under APPDIR.
- BIN is the
binfolder right under APPDIR
- CONFIG is APPDIR
- IGNOREDIR is APPDIR
(I assume you have Python and the necessary mysql connector).
Currently supporting only manual (very simple) installation.
- Checkout/export the project where ever you want. This folder becomes APPDIR.
- Check your ASSETS folder has the following subfolders:
autocompletion, functions, scripts, sp, triggers, views
- Copy directory cp -r example_config config
- Open CONFIG and make sure the DB credentials are correct
- If not existing, create DB folders. For example, if u have a database named proddb and it has stored procedures and triggers, go to
ASSETS/spand create folder
proddb. Then go to folder
ASSETS/triggersand create folder
proddb. So you end with
ASSETS/sp/triggers. (Check the examle_assets structure, which is setup for DBs dhara and dhara_views).
- Run the
test.pyunder the BIN to see all is good.
You Are Done!
Examples: CD to bin
build all elements 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 drop.py --all
build all stored procedures build.py -s
drop all triggers in DB dhara drop.py -t -ddhara
Clean all objects in all the databases in assets cleaner.py --all