mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibSQL: Immediately commit database modifications (for now)
This ensures tables survive the database connection quitting. LibSQL does not have transactional sessions yet, and probably won't for a while, so let's just commit each modification as it comes.
This commit is contained in:
committed by
Linus Groh
parent
8f3c22718e
commit
17988bab75
Notes:
sideshowbarker
2024-07-17 05:21:12 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/17988bab75 Pull-request: https://github.com/SerenityOS/serenity/pull/16239 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/linusg
@@ -66,17 +66,7 @@ ErrorOr<void> Database::open()
|
||||
return {};
|
||||
}
|
||||
|
||||
Database::~Database()
|
||||
{
|
||||
// This crashes if the database can't commit. It's recommended to commit
|
||||
// before the Database goes out of scope so the application can handle
|
||||
// errors.
|
||||
// Maybe we should enforce that by having a VERIFY here that there are no
|
||||
// pending writes. But that's a new API on Heap so let's not do that right
|
||||
// now.
|
||||
if (is_open())
|
||||
MUST(commit());
|
||||
}
|
||||
Database::~Database() = default;
|
||||
|
||||
ErrorOr<void> Database::commit()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user