1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

Ladybird+LibWebView: Move creation of the SQL client to LibWebView

This lets us remove the direct dependency from Ladybird to LibSQL.
This commit is contained in:
Timothy Flynn 2023-08-31 07:21:54 -04:00 committed by Andreas Kling
parent 5c5a00dd3a
commit e26ead0995
5 changed files with 18 additions and 8 deletions

View file

@ -17,6 +17,16 @@ ErrorOr<NonnullRefPtr<Database>> Database::create()
return create(move(sql_client));
}
#if !defined(AK_OS_SERENITY)
ErrorOr<NonnullRefPtr<Database>> Database::create(Vector<String> candidate_sql_server_paths)
{
auto sql_client = TRY(SQL::SQLClient::launch_server_and_create_client(move(candidate_sql_server_paths)));
return create(move(sql_client));
}
#endif
ErrorOr<NonnullRefPtr<Database>> Database::create(NonnullRefPtr<SQL::SQLClient> sql_client)
{
auto connection_id = sql_client->connect(database_name);