Class: LogStruct::Log::SQL
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::SQL
- Extended by:
- T::Sig
- Includes:
- Interfaces::AdditionalDataField, Interfaces::CommonFields, LogStruct::Log::Shared::MergeAdditionalDataFields, LogStruct::Log::Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/sql.rb
Instance Method Summary collapse
Methods included from LogStruct::Log::Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
#event, #level, #serialize, #source, #timestamp
Methods included from LogStruct::Log::Shared::MergeAdditionalDataFields
Methods included from Interfaces::AdditionalDataField
Instance Method Details
#to_h ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/log_struct/log/sql.rb', line 55 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::Message] = h[LogField::Sql] = sql h[LogField::Name] = name h[LogField::DurationMs] = duration_ms h[LogField::RowCount] = row_count unless row_count.nil? h[LogField::Adapter] = adapter unless adapter.nil? h[LogField::BindParams] = bind_params unless bind_params.nil? h[LogField::DatabaseName] = database_name unless database_name.nil? h[LogField::ConnectionPoolSize] = connection_pool_size unless connection_pool_size.nil? h[LogField::ActiveConnections] = active_connections unless active_connections.nil? h[LogField::OperationType] = operation_type unless operation_type.nil? h[LogField::TableNames] = table_names unless table_names.nil? h end |