We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CURRENT_TIMESTAMP
chrono::DateTime<chrono::Utc>
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I deserializing from CURRENT_TIMESTAMP to chrono::DateTime<chrono::Utc>, serde_rusqlite::from_rows returns an error.
serde_rusqlite::from_rows
anyhow = "^1.0" serde = { version = "^1.0", features = ["derive"] } chrono = { version = "~0.4", features = ["serde"] } rusqlite = { version = "~0.31", features = ["bundled"] } serde_rusqlite = "~0.35"
use anyhow::Result; use chrono::{DateTime, Utc}; use rusqlite::Connection; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] struct Timed { time: DateTime<Utc> } fn main() -> Result<()> { let connection = Connection::open_in_memory()?; connection.execute("CREATE TABLE test (time TIMESTAMP)", [])?; connection.execute("INSERT INTO test (time) VALUES (CURRENT_TIMESTAMP)", [])?; let mut statement = connection.prepare("SELECT * FROM test")?; let mut iter = serde_rusqlite::from_rows::<Timed>(statement.query([])?); while let Some(timed) = iter.next() { let timed = timed?; println!("{:?}", timed); } Ok(()) }
Error: Deserialization failed for column: time error: premature end of input
This may not a bug in serde_rusqlite, but it will be great if this crate can handle this situation correctly.
serde_rusqlite
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I deserializing from
CURRENT_TIMESTAMP
tochrono::DateTime<chrono::Utc>
,serde_rusqlite::from_rows
returns an error.Dependencies
Code
Print
Thought
This may not a bug in
serde_rusqlite
, but it will be great if this crate can handle this situation correctly.The text was updated successfully, but these errors were encountered: