Open
Description
Hi there,
can you please give me an advice how to store JSONB (binary) values into postgresql?
Table
create table tb_test
(
"value" jsonb,
);
What I tried
let params = vec![
ParameterValue::Binary(json_string.into_bytes()),
];
connection.execute("INSERT INTO tb_test VALUES ($1)", ¶ms);
error output:
Error::QueryFailed("Error { kind: ToSql(1), cause: Some(WrongType { postgres: Jsonb, rust: \"alloc::vec::Vec<u8>\" }) }")
also as string does not work
let params = vec![
ParameterValue::Str(json_string.clone()),
];
connection.execute("INSERT INTO tb_test VALUES ($1)", ¶ms);
error output:
fail: Error::QueryFailed("Error { kind: ToSql(1), cause: Some(WrongType { postgres: Jsonb, rust: \"alloc::string::String\" }) }")
environment
- spin: 3.0.0
- postgresql: 17
- rust
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog