mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00: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
@@ -14,7 +14,12 @@ namespace SQL::AST {
|
||||
ResultOr<ResultSet> Statement::execute(AK::NonnullRefPtr<Database> database) const
|
||||
{
|
||||
ExecutionContext context { move(database), this, nullptr };
|
||||
return execute(context);
|
||||
auto result = TRY(execute(context));
|
||||
|
||||
// FIXME: When transactional sessions are supported, don't auto-commit modifications.
|
||||
TRY(context.database->commit());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user