MikhailNazarov / ydb-rs-sqlx

Sqlx integration for YDB rust SDK
https://ydb.tech/
Apache License 2.0
2 stars 1 forks source link

failed to convert from Optional to alloc::string::String #4

Open MikhailNazarov opened 3 months ago

MikhailNazarov commented 3 months ago
CREATE TABLE IF NOT EXISTS test_opt(
      id Int32 NOT NULL,
      title Utf8,
      PRIMARY KEY (id)
  );
  insert into test_opt(id, title) values
        (1, 'title1'),
        (2, 'title2'),
        (3, 'title3')
;

then

let rows = sqlx::query_as::<_,(i32, Option<String>)>(r#"
        select * from test_opt
    "#).fetch_all(&mut *conn).await.unwrap();

cause error:

ColumnDecode { index: "1", source: Convert("failed to convert from Optional to alloc::string::String")