db module

class db.database(hostVar, userVar, passwdVar, databaseVar, portVar, auth_pluginVar)

Bases: object

cursor = None
db = None
async findStudentNumber(studentNumber)

Returns results Select statement that looks for a student number in the student table

Parameters

studentNumber (String) – MKWZWA0003

Returns

List of records obtained from the query

Return type

List

getCurrentActivity()

Returns the activity that is currently scheduled for the specific lab

Returns

The response from the database containing information about scheduled activity

Return type

List

getDB()
async insertData(query)

Inserts data to the enrolls the database using the given qeury

Parameters

query (String) – query to be executed on the database

async markAttendance(student_no)

Changes status bit from 0 to 1 in the register schema for student with student number student_no

Parameters

student_no (String) – Student number of student

markRegister(studentNumber, activity)

[summary]

Parameters
  • studentNumber ([type]) – [description]

  • activity ([type]) – [description]

async postTempReading(student_no, tempValaue)

Records the temperature reading from the student in the database

Parameters
  • student_no (String) – Student number of student

  • tempValaue (String) – The temperature reading from student