I have prepared a code to connect PostgreSQL database and run a query on the database using PyQGIS and it is running successfully on python console of QGIS. I want the same to happen using QGIS Python Plugin. How can I write that in a Python Plugin File or inside which method shall I write the same.