Skip to content

Commit 5b72aa7

Browse files
authored
add test append string as ts (#75)
Change-Id: I8b8db2685136f54e19ba4ab9557d197cd5e7a9ec
1 parent cca2f64 commit 5b72aa7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/appender.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,19 @@ mod test {
204204
assert_eq!(val, (id,));
205205
Ok(())
206206
}
207+
208+
#[test]
209+
fn test_append_string_as_ts_row() -> Result<()> {
210+
let db = Connection::open_in_memory()?;
211+
db.execute_batch("CREATE TABLE foo(x TIMESTAMP)")?;
212+
213+
{
214+
let mut app = db.appender("foo")?;
215+
app.append_row(["2022-04-09 15:56:37.544"])?;
216+
}
217+
218+
let val = db.query_row("SELECT x FROM foo", [], |row| <(String,)>::try_from(row))?;
219+
assert_eq!(val, ("2022-04-09 15:56:37.544".to_string(),));
220+
Ok(())
221+
}
207222
}

0 commit comments

Comments
 (0)