.Dd January 24, 2024 .Dt SQLITE3_DB_FILENAME 3 .Os .Sh NAME .Nm sqlite3_db_filename .Nd return the filename for a database connection .Sh SYNOPSIS .In sqlite3.h .Ft sqlite3_filename .Fo sqlite3_db_filename .Fa "sqlite3 *db" .Fa "const char *zDbName" .Fc .Sh DESCRIPTION The sqlite3_db_filename(D,N) interface returns a pointer to the filename associated with database N of connection D. 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. .Pp The string value returned by this routine is owned and managed by the database connection. The value will be valid until the database N is DETACH-ed or until the database connection closes. .Pp The filename returned by this function is the output of the xFullPathname method of the VFS. 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. .Pp If the filename pointer returned by this routine is not NULL, then it can be used as the filename input parameter to these routines: .Bl -bullet .It .Fn sqlite3_uri_parameter .It .Fn sqlite3_uri_boolean .It .Fn sqlite3_uri_int64 .It .Fn sqlite3_filename_database .It .Fn sqlite3_filename_journal .It .Fn sqlite3_filename_wal .El .Pp .Sh IMPLEMENTATION NOTES These declarations were extracted from the interface documentation at line 6613. .Bd -literal SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName); .Ed .Sh SEE ALSO .Xr sqlite3_filename_database 3 , .Xr sqlite3_uri_parameter 3