/Database-Applications

Set of python scripts to display results from a MySQL query in a GUI

Primary LanguagePython

Database-Applications

If the headers or lists aren't anchors, their documentation has not yet been written.

GUI uses wxPython framework

Files

Main.py is used for testing and use case referencing mysql implementations.

Global Variables

Variable Description
data {} Used to reference locally stored credentials from the Credentials.json file for the database LEGACY
views [] Used to reference the views from the database LEGACY
tables [] Used to reference the tables from the database LEGACY
connect Connection Connection object
mydb mysql.connector.connection Reference to connect.db
cursor mysql.connector.cursor Refeence to mydb.cursor()

Functions

Function Description
void init() Populates views and tables LEGACY
void dispTables() Prints all tables from tables list
void dispTable(str) Prints the data stored in the specified table
void dispViews() Prints all the views from views list
void dispView(str) Prints all the data stored in the specified view
str getUsers() Returns an array of all the users in a database
dict getCredentials() Opens and reads Credentials.json file to return a dictionary of the some of the users of the database LEGACY

Handles the UI aspects of the application.
Classes :

Classes

Used to initialise the application

Functions

bool OnInit() | Starts application

Used to allow a user to login to the database. If the takes the inputs from inputName and inputPassword to attempt connecting to the database

Frame Style:

  • wx.MAXIMIZE_BOX (user can minmize window)
  • wx.CLOSE_BOX (user can close the window)

Sizer:

  • Name: sizer
  • Type: wx.BoxSizer

Text Inputs:

  • inputName:
    • Purpose: Input field for the username
    • Sizer: sizer
  • inputPassword :
    • Purpose: Input field for the password
    • Style: TE_PASSWORD (hides the input)
    • Sizer: sizer
  • loginBTN:
    • Purpose: Attempts to login into database
    • Binded to: loginBTNListener()
    • Sizer: sizer

Static Texts:

  • LoginPrompt :
    • Purpose:
      • Tells the user to log in
      • If the log in fails, it's used to tell the user that it failed