Skip to content

Commit b8fa7a1

Browse files
committed
enable extensions in open of database
1 parent 4cfd50a commit b8fa7a1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/octave_sqlite.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,20 @@ octave_sqlite::create (const std::string &infilename, const std::string &inmode)
236236

237237
rc = sqlite3_open_v2(filename.c_str(), &db, flags, NULL);
238238

239-
if(rc)
239+
if (rc)
240240
{
241241
sqlite3_close(db);
242242
error("Failed to open '%s' - %s", filename.c_str(), error_string(db, rc).c_str());
243243
return false;
244244
}
245245

246+
//Enable loading of external extensions (e.g. sqlean)
247+
rc = sqlite3_enable_load_extension(db, 1);
248+
if (rc)
249+
{
250+
warning("Failed to enable load extensions - '%s'", error_string(db, rc).c_str());
251+
}
252+
246253
return true;
247254
}
248255

0 commit comments

Comments
 (0)