20#ifndef ORES_IAM_REPOSITORY_SESSION_ENTITY_HPP
21#define ORES_IAM_REPOSITORY_SESSION_ENTITY_HPP
26#include "sqlgen/Timestamp.hpp"
27#include "sqlgen/PrimaryKey.hpp"
38 constexpr static const char* schema =
"production";
39 constexpr static const char* tablename =
"iam_sessions_tbl";
44 sqlgen::PrimaryKey<std::string>
id;
56 sqlgen::PrimaryKey<sqlgen::Timestamp<
"%Y-%m-%d %H:%M:%S">>
start_time;
108std::ostream& operator<<(std::ostream& s,
const session_entity& v);
114 constexpr static const char* schema =
"production";
115 constexpr static const char* tablename =
"iam_session_stats_tbl";
118 std::string account_id;
119 std::int64_t session_count = 0;
120 double avg_duration_seconds = 0.0;
121 std::int64_t total_bytes_sent = 0;
122 std::int64_t total_bytes_received = 0;
Database persistence layer for IAM domain types.
Definition account_entity.hpp:27
Represents a session record in the database.
Definition session_entity.hpp:37
std::string client_identifier
Client application identifier from handshake.
Definition session_entity.hpp:75
std::string client_ip
Client IP address (IPv4 or IPv6).
Definition session_entity.hpp:70
sqlgen::PrimaryKey< std::string > id
Session UUID - part of composite primary key.
Definition session_entity.hpp:44
sqlgen::PrimaryKey< sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> > start_time
Session start timestamp - part of composite primary key.
Definition session_entity.hpp:56
std::int64_t bytes_sent
Total bytes sent to client.
Definition session_entity.hpp:90
std::string account_id
Foreign key to accounts table.
Definition session_entity.hpp:49
std::int64_t bytes_received
Total bytes received from client.
Definition session_entity.hpp:95
int client_version_major
Client protocol version major number.
Definition session_entity.hpp:80
std::string protocol
Protocol used for this session (binary or http).
Definition session_entity.hpp:105
std::string country_code
ISO 3166-1 alpha-2 country code.
Definition session_entity.hpp:100
int client_version_minor
Client protocol version minor number.
Definition session_entity.hpp:85
std::string end_time
Session end timestamp. Empty string if session is active.
Definition session_entity.hpp:65
Entity for session statistics from continuous aggregates.
Definition session_entity.hpp:113