sticker/Database: add method Reopen()

This commit is contained in:
Max Kellermann
2023-07-23 09:32:52 +02:00
parent dc31aa6a61
commit fbdd2324a5
2 changed files with 18 additions and 4 deletions

View File

@@ -67,11 +67,10 @@ static constexpr const char sticker_sql_create[] =
" sticker_value ON sticker(type, uri, name);"
"";
StickerDatabase::StickerDatabase(Path path)
:db(NarrowPath(path))
StickerDatabase::StickerDatabase(const char *_path)
:path(_path),
db(path.c_str())
{
assert(!path.IsNull());
int ret;
/* create the table and index */
@@ -91,6 +90,9 @@ StickerDatabase::StickerDatabase(Path path)
}
}
StickerDatabase::StickerDatabase(Path _path)
:StickerDatabase(NarrowPath{_path}) {}
StickerDatabase::~StickerDatabase() noexcept
{
if (db == nullptr)