mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
When compiled with SQLITE_OS_KV_OPTIONAL, the magic names ":localStorage:"
and ":sessionStorage:" are recognized and converted to use the kv-vfs. FossilOrigin-Name: c5db9262d0388ccb0e84c6a4b4e2e786dd634f13874e4034ba7b175befa4ce90
This commit is contained in:
13
src/main.c
13
src/main.c
@@ -3352,6 +3352,19 @@ static int openDatabase(
|
||||
goto opendb_out;
|
||||
}
|
||||
|
||||
#if SQLITE_OS_UNIX && defined(SQLITE_OS_KV_OPTIONAL)
|
||||
/* Process magic filenames ":localStorage:" and ":sessionStorage:" */
|
||||
if( zFilename && zFilename[0]==':' ){
|
||||
if( strcmp(zFilename, ":localStorage:")==0 ){
|
||||
zFilename = "file:local?vfs=kvvfs";
|
||||
flags |= SQLITE_OPEN_URI;
|
||||
}else if( strcmp(zFilename, ":sessionStorage:")==0 ){
|
||||
zFilename = "file:session?vfs=kvvfs";
|
||||
flags |= SQLITE_OPEN_URI;
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_OS_UNIX && defined(SQLITE_OS_KV_OPTIONAL) */
|
||||
|
||||
/* Parse the filename/URI argument
|
||||
**
|
||||
** Only allow sensible combinations of bits in the flags argument.
|
||||
|
Reference in New Issue
Block a user