1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +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:
Timothy Flynn 2022-10-27 09:06:13 -04:00 committed by Linus Groh
parent 8f3c22718e
commit 17988bab75
2 changed files with 7 additions and 12 deletions

View file

@ -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;
}
}