Saturday 30 May 2020

Database Change request deployment tool with GUI

This is not quite finished but it is nearly there, a little python script that runs change requests into a database. There is a GUI to select your team and enter your change request numbers or to select the folder of your changes (this second option is not actually coded yet). I also want to add 

The script will then: 

1. Create a log file to be saved with timestamp and user (also output to the screen).
2. Call a function that runs the change requests this.
3. Looks in the relevant CR folder picked by the GUI and finds the config text file. Which looks like: 
 


4. The script looks for the keyword user and connects as the user it finds on that line, it connects by looking in a reference file for an encrypted password with it decodes and uses for the connection string.
5. The file specified and it can be numerous files over different lines, are opened one at a time and all statements in the file will be individually parsed and run against the database as the user in question. e.g. 

6. Any errors messages will be captured although currently it does not capture the output from individual statements e.g. I want to see Table Dropped for the first statement above. 
7. Whilst above is running the above is all logged in the DB and in the log file so it can be picked apart. 

Code below and I will try and post a video of it working as well. Overall I am really pleased with the so far, I have build my first (very) simple GUI, used encryption, connected to Oracle (and I can pull data using pandas as well), created the log filing process and the mechanism to loop through the files. A lot of the stuff I have done here has come from books or stackoverflow answers. 



No comments:

Post a Comment