Given an sqlite3 connection object, how can retrieve the file path to the sqlite3 file?
Given an sqlite3 connection object, how can retrieve the file path to the sqlite3
Share
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.
The Python connection object doesn’t store this information.
You could store the path before you open the connection:
or you can ask the database itself what connections it has, using the
database_listpragma:If you used a connection URI (connecting with the
sqlite3.connect()parameteruri=True), the filename will not include the URI parameters or thefile://prefix.