summaryrefslogtreecommitdiff
path: root/Userland/Services/SQLServer/ClientConnection.h
blob: 96af97fe7095121552d3d6f432f85cac71c64484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/HashMap.h>
#include <LibIPC/ClientConnection.h>
#include <SQLServer/SQLClientEndpoint.h>
#include <SQLServer/SQLServerEndpoint.h>

namespace SQLServer {

class ClientConnection final
    : public IPC::ClientConnection<SQLClientEndpoint, SQLServerEndpoint> {
    C_OBJECT(ClientConnection);

public:
    explicit ClientConnection(NonnullRefPtr<Core::LocalSocket>, int client_id);
    virtual ~ClientConnection() override;

    virtual void die() override;

    static RefPtr<ClientConnection> client_connection_for(int client_id);

private:
    virtual Messages::SQLServer::ConnectResponse connect(String const&) override;
    virtual Messages::SQLServer::SqlStatementResponse sql_statement(int, String const&) override;
    virtual void statement_execute(int) override;
    virtual void disconnect(int) override;
};

}