I have a several postgres and mysql cursor objects exposed to me, created in some universe. How to find the database name (and other info about that db) from these cursor objects?
cursor.__dict__ gives nothing useful.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know about postgres but using MySQLdb you could always use the following:
Maybe there’s a cleaner way to do this…
Edit:
for other info it depends on what exactly you’re looking for but for example to fetch table names
There are many other functions available… Is there anything specific you’re looking for?