- 3개의 패턴이 있다.
나는 주로 sqlite3_open_v2를 애용하고 있다.
int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb /* OUT: SQLite db handle */ ); int sqlite3_open16( const void *filename, /* Database filename (UTF-16) */ sqlite3 **ppDb /* OUT: SQLite db handle */ ); int sqlite3_open_v2( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb, /* OUT: SQLite db handle */ int flags, /* Flags */ const char *zVfs /* Name of VFS module to use */ );
sqlite3_open_v2의 flags인수로 사용가능한 것은
SQLITE_OPEN_NOMUTEX
- mutexes(Mutual Exclusion Object) on the opened database connection are disabled and the application must insure that access to the database connection and its associated prepared statement is serialized.
- 뮤텍스를 보장하지 않는다.
SQLITE_OPEN_FULLMUTEX
SQLITE_OPEN_SHAREDCACHE
SQLITE_OPEN_PRIVATECACHE
SQLITE_OPEN_READONLY
- the database is opened in read-only mode. If the database does not already exist, an error is returned.
SQLITE_OEPN_READWRITE
- The database is opened for reading and writing, or reading only if the file is write protected by the OS.
SQLITE_OEPN_READWRITE|SQLITE_OPEN_CREATE
SQLITE_OEPN_READWRITE + the database is created if it does not already exist.
Comments