Small. Fast. Reliable.
Choose any three.

SQLite C Interface

Return The Filename For A Database Connection

const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);

R-31200-13290:[The sqlite3_db_filename(D,N) interface returns a pointer to the filename associated with database N of connection D. ] R-63920-18609:[If there is no attached database N on the database connection D, or if database N is a temporary or in-memory database, then this function will return either a NULL pointer or an empty string. ]

R-53717-22688:[The string value returned by this routine is owned and managed by the database connection. ] R-50620-43692:[The value will be valid until the database N is DETACH-ed or until the database connection closes. ]

R-41640-10889:[The filename returned by this function is the output of the xFullPathname method of the VFS. ] R-42868-39706:[In other words, the filename will be an absolute pathname, even if the filename used to open the database originally was a URI or relative pathname. ]

If the filename pointer returned by this routine is not NULL, then it can be used as the filename input parameter to these routines:

See also lists of Objects, Constants, and Functions.