mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
fix: decode postgres time without subsecond (#2784)
* fix: decode postgres time without subsecond * update: decode postgres time without subsecond by making subsecond optional
This commit is contained in:
@@ -42,7 +42,8 @@ impl<'r> Decode<'r, Postgres> for Time {
|
||||
|
||||
PgValueFormat::Text => Time::parse(
|
||||
value.as_str()?,
|
||||
&format_description!("[hour]:[minute]:[second].[subsecond]"),
|
||||
// Postgres will not include the subsecond part if it's zero.
|
||||
&format_description!("[hour]:[minute]:[second][optional [.[subsecond]]]"),
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user