Skip to content

Commit d5ede6c

Browse files
cridenour2shady4u
authored andcommitted
Enable the use of shared in-memory databases
(cherry picked from commit 216de25)
1 parent 484b67e commit d5ede6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gdsqlite.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool SQLite::open_db()
6969
{
7070
char *zErrMsg = 0;
7171
int rc;
72-
if (path != ":memory:")
72+
if (path.find(":memory:") == -1)
7373
{
7474
/* Add the default_extension to the database path if no extension is present */
7575
/* Skip if the default_extension is an empty string to allow for paths without extension */
@@ -108,7 +108,7 @@ bool SQLite::open_db()
108108
/* Try to open the database */
109109
if (read_only)
110110
{
111-
if (path != ":memory:")
111+
if (path.find(":memory:") == -1)
112112
{
113113
sqlite3_vfs_register(gdsqlite_vfs(), 0);
114114
rc = sqlite3_open_v2(char_path, &db, SQLITE_OPEN_READONLY, "godot");
@@ -122,7 +122,7 @@ bool SQLite::open_db()
122122
}
123123
else
124124
{
125-
rc = sqlite3_open_v2(char_path, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
125+
rc = sqlite3_open_v2(char_path, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI, NULL);
126126
/* Identical to: `rc = sqlite3_open(char_path, &db);`*/
127127
}
128128

0 commit comments

Comments
 (0)