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.

Author nedbat
Recipients nedbat
Date 2022-01-16.17:42:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org>
In-reply-to
Content
The sqlite3 library implicitly creates the database if the requested file doesn't exist.  I would like to be able to avoid that implicit creation.  (Actually, it would be enough to know whether I had created the database, but the underlying SQLite library doesn't seem to indicate that.)

The C code currently hard-codes the SQLite flag to create the database if it doesn't exist:

    rc = sqlite3_open_v2(database, &db,
                         SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
                         (uri ? SQLITE_OPEN_URI : 0), NULL);

Could we make this an option, so the Python code could avoid implicit creation?
History
Date User Action Args
2022-01-16 17:42:31nedbatsetrecipients: + nedbat
2022-01-16 17:42:31nedbatsetmessageid: <1642354951.94.0.0196272577556.issue46402@roundup.psfhosted.org>
2022-01-16 17:42:31nedbatlinkissue46402 messages
2022-01-16 17:42:31nedbatcreate