1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add the sqlite3_db_filename() interface.

FossilOrigin-Name: 93a947989b57959aacc37007a143fdf3921793ab
This commit is contained in:
drh
2011-11-17 00:56:20 +00:00
parent f20fb8c6f3
commit 283829cb20
6 changed files with 78 additions and 10 deletions

View File

@@ -2970,3 +2970,17 @@ const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
}
return 0;
}
/*
** Return the filename of the database associated with a database
** connection.
*/
const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
int i;
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt && sqlite3StrICmp(zDbName, db->aDb[i].zName)==0 ){
return sqlite3BtreeGetFilename(db->aDb[i].pBt);
}
}
return 0;
}