io.randomseed.utils.db.types
added in 1.0.0
Opinionated database type conversions.
add-all-accessors
(add-all-accessors)
Adds all opinionated readers and setters by calling add-all-readers
and add-all-setters
.
add-all-readers
(add-all-readers)
Adds all opinionated readers by calling add-reader-date
and add-reader-blob
.
add-all-setters
(add-all-setters)
Adds all opinionated setters by calling add-setter-date
and add-setter-ip-address
.
add-reader-blob
(add-reader-blob)
Extends next.jdbc.result-set/ReadableColumn
protocol to support binary large object (BLOB) conversions, so java.sql.Blob
data are converted to an array of bytes (bytes[]
).
add-reader-date
(add-reader-date)
Extends next.jdbc.result-set/ReadableColumn
protocol to support date/time conversions so java.sql.Date
data are passed as-is and java.sql.Timestamp
data are converted to java.sql.Timestamp
.
add-setter-date
(add-setter-date)
Extends next.jdbc.prepare/SettableParameter
protocol to support date/time conversions so java.sql.Date
data are saved using .setDate
method and java.sql.Timestamp
, java.time.Instant
, java.time.ZonedTime
, java.time.LocalDate
, java.time.LocalDateTime
and java.util.Date
are saved with .setTimestamp
. Also note that java.time.Instant
, java.time.ZonedDateTime
and java.util.Date
are explicitly converted to UTC before saving.
add-setter-ip-address
(add-setter-ip-address)
Extends next.jdbc.prepare/SettableParameter
protocol to support IP address conversions so inet.ipaddr.ipv4.IPv4Address
data are converted to inet.ipaddr.ipv6.IPv6Address
, then to an array of bytes and then saved using .setBytes
method. Similarly, inet.ipaddr.ipv6.IPv6Address
data are converted to an array of bytes and then saved with .setBytes
.
add-setter-phone-number
(add-setter-phone-number)
Extends next.jdbc.prepare/SettableParameter
protocol to support phone number conversions so com.google.i18n.phonenumbers/Phonenumber$PhoneNumber
data are converted to strings (in E.164 format) and then saved.
add-setter-uuid
(add-setter-uuid)
Extends next.jdbc.prepare/SettableParameter
protocol to support UUID conversions so java.util.UUID
data are converted to an array of bytes and then saved using .setBytes
method.