module DB::MetadataValueConverter
Overview
This module converts DB supported values to ::Log::Metadata::Value
Note to implementors
If the driver defines custom types to be used as arguments the default behavior
will be converting the value via #to_s
. Otherwise you can define overloads to
change this behaviour.
module DB::MetadataValueConverter
def self.arg_to_log(arg : PG::Geo::Point)
::Log::Metadata::Value.new("(#{arg.x}, #{arg.y})::point")
end
end
Defined in:
db/statement.crClass Method Summary
-
.arg_to_log(arg : Enumerable) : ::Log::Metadata::Value
Returns arg encoded as a
::Log::Metadata::Value
. -
.arg_to_log(arg : UInt64) : ::Log::Metadata::Value
Returns arg encoded as a
::Log::Metadata::Value
. -
.arg_to_log(arg : Int) : ::Log::Metadata::Value
Returns arg encoded as a
::Log::Metadata::Value
. -
.arg_to_log(arg : Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Time) : ::Log::Metadata::Value
Returns arg encoded as a
::Log::Metadata::Value
. -
.arg_to_log(arg) : ::Log::Metadata::Value
Returns arg encoded as a
::Log::Metadata::Value
.
Class Method Detail
def self.arg_to_log(arg : Enumerable) : ::Log::Metadata::Value
#
Returns arg encoded as a ::Log::Metadata::Value
.
def self.arg_to_log(arg : UInt64) : ::Log::Metadata::Value
#
Returns arg encoded as a ::Log::Metadata::Value
.
def self.arg_to_log(arg : Int) : ::Log::Metadata::Value
#
Returns arg encoded as a ::Log::Metadata::Value
.
def self.arg_to_log(arg : Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Time) : ::Log::Metadata::Value
#
Returns arg encoded as a ::Log::Metadata::Value
.
def self.arg_to_log(arg) : ::Log::Metadata::Value
#
Returns arg encoded as a ::Log::Metadata::Value
.