Is there a way I can get a SQLite database name in Python.
I am using the following code to get the database name:
con=sqlite3.connect(":memory:")
cursor = con.cursor()
cursor.execute("PRAGMA database_list;")
curr_table = cursor.fetchall()
But the output I get is:
[(0, u'main', u'')]
When I should be getting something like
[(0,u'main',u'/Users/testdb.db'),
(2,u'test',u'/Users/testdb.db')]
:memory:so you won't see them. Read the docs: sqlite.org/pragma.html#pragma_database_list