SQLITE3_DB_NAME(3)

NAME
sqlite3_db_name - return the schema name for a database connection

SYNOPSIS
#include <sqlite3.h>
const char *
sqlite3_db_name(sqlite3 *db, int N);

DESCRIPTION
The sqlite3_db_name(D,N) interface returns a pointer to the schema name for the N-th database on database connection D, or a NULL pointer of N is out of range. An N value of 0 means the main database file. An N of 1 is the "temp" schema. Larger values of N correspond to various ATTACH-ed databases.

Space to hold the string that is returned by sqlite3_db_name() is managed by SQLite itself. The string might be deallocated by any operation that changes the schema, including ATTACH or DETACH or calls to sqlite3_serialize() or sqlite3_deserialize(), even operations that occur on a different thread. Applications that need to remember the string long-term should make their own copy. Applications that are accessing the same database connection simultaneously on multiple threads should mutex-protect calls to this API and should make their own private copy of the result prior to releasing the mutex.

IMPLEMENTATION NOTES
These declarations were extracted from the interface documentation at line 6633.

    SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);

SEE ALSO
sqlite3_deserialize(3), sqlite3_serialize(3)