I have a bunch of sqlite db's floating around in my app (dont ask) and I need to be able to get the file location of the dbs. Is there any way of doing this by using the sqlite3 object? (I.e. not having to store the path alongside the db when the db was created)
Bonus Question: If there are more than one db attached to the sqlite3 object, how do I get the others as well (they were ATTACHed)?
Thanks!
Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.
SQLite Python: Querying Data First, establish a connection to the SQLite database by creating a Connection object. Next, create a Cursor object using the cursor method of the Connection object. Then, execute a SELECT statement. After that, call the fetchall() method of the cursor object to fetch the data.
API function: sqlite3_db_filename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With