1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00
serenity/Userland/Services/SQLServer/ConnectionFromClient.h
Timothy Flynn b3e287342f SQLServer: Store LibSQL database files in the standard data directory
This also allows for overriding the path. Ladybird will want to store
the database files in a subdirectory of the standard data directory that
contains the Ladybird application name.

Fixes #16000.
2022-12-08 17:14:48 +01:00

42 lines
1.2 KiB
C++

/*
* Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/HashMap.h>
#include <AK/Vector.h>
#include <LibIPC/ConnectionFromClient.h>
#include <SQLServer/SQLClientEndpoint.h>
#include <SQLServer/SQLServerEndpoint.h>
namespace SQLServer {
class ConnectionFromClient final
: public IPC::ConnectionFromClient<SQLClientEndpoint, SQLServerEndpoint> {
C_OBJECT(ConnectionFromClient);
public:
virtual ~ConnectionFromClient() override = default;
virtual void die() override;
static RefPtr<ConnectionFromClient> client_connection_for(int client_id);
void set_database_path(DeprecatedString);
private:
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
virtual Messages::SQLServer::ConnectResponse connect(DeprecatedString const&) override;
virtual Messages::SQLServer::PrepareStatementResponse prepare_statement(u64, DeprecatedString const&) override;
virtual Messages::SQLServer::ExecuteStatementResponse execute_statement(u64, Vector<SQL::Value> const& placeholder_values) override;
virtual void disconnect(u64) override;
DeprecatedString m_database_path;
};
}