This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: sqlite3 get the connected database url
Type: enhancement Stage: resolved
Components: Versions: Python 3.8
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: DamlaAltun, berker.peksag, ghaering, midnio
Priority: normal Keywords:

Created on 2018-11-18 13:36 by midnio, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg330047 - (view) Author: Muhammed Alkan (midnio) Date: 2018-11-18 13:36
A feature for to get the connected database path or URL from connection object (sqlite3.Connection).
msg330048 - (view) Author: DamlaAltun (DamlaAltun) * Date: 2018-11-18 13:38
Yeah, that would be great enhancement
msg330049 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-11-18 14:09
Just to be sure, what do you want to do is

    import sqlite3

    conn = sqlite3.connect("foo.db")

    assert conn.database_path == "foo.db"


I don't think that's something worth to expose in the Connection object. What's your use case?
msg330050 - (view) Author: Muhammed Alkan (midnio) Date: 2018-11-18 14:32
The use case could be

- Using it to check if you're connected to
  correct database (as you know the mutability could change the connection)

- Getting the name, helping the developers while debugging.

- No more reasons :P
Date User Action Args
2022-04-11 14:59:08adminsetgithub: 79453
2019-03-31 15:05:43berker.peksagsetstatus: open -> closed
resolution: rejected
stage: resolved
2018-11-18 14:32:51midniosetmessages: + msg330050
2018-11-18 14:09:32berker.peksagsetmessages: + msg330049
2018-11-18 13:38:15DamlaAltunsetnosy: + DamlaAltun
messages: + msg330048
2018-11-18 13:36:06midniocreate