Git Product home page Git Product logo

ydb-rs-sqlx's People

Contributors

mikhailnazarov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ydb-rs-sqlx's Issues

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

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")

Error in the example

Hi! Thank you for your interesting crate!

ydb-rs-sqlx/target/debug/example`

2024-07-04T05:20:54.029986Z ERROR ydb::client_table: error=YdbStatusError(YdbStatusError { message: "Operation { id: \"\", ready: true, status: SchemeError, issues: [IssueMessage { position: None, message: \"Type annotation\", end_position: None, issue_code: 1030, severity: 1, issues: [IssueMessage { position: Some(Position { row: 4, column: 1, file: \"\" }), message: \"At function: KiReadTable!\", end_position: Some(Position { row: 4, column: 1, file: \"\" }), issue_code: 0, severity: 1, issues: [IssueMessage { position: Some(Position { row: 4, column: 1, file: \"\" }), message: \"Cannot find table 'db.[/local/test2]' because it does not exist or you do not have access permissions. Please check correctness of table path and user permissions.\", end_position: Some(Position { row: 4, column: 1, file: \"\" }), issue_code: 2003, severity: 1, issues: [] }] }] }], result: Some(Any { type_url: \"type.googleapis.com/Ydb.Table.ExecuteQueryResult\", value: [18, 0] }), metadata: None, cost_info: None }", operation_status: 400070, issues: [YdbIssue { issue_code: 1030, message: "Type annotation", issues: [YdbIssue { issue_code: 0, message: "At function: KiReadTable!", issues: [YdbIssue { issue_code: 2003, message: "Cannot find table 'db.[/local/test2]' because it does not exist or you do not have access permissions. Please check correctness of table path and user permissions.", issues: [], severity: Error }], severity: Error }], severity: Error }] })
Error: Database(InternalError { message: "Operation { id: \"\", ready: true, status: SchemeError, issues: [IssueMessage { position: None, message: \"Type annotation\", end_position: None, issue_code: 1030, severity: 1, issues: [IssueMessage { position: Some(Position { row: 4, column: 1, file: \"\" }), message: \"At function: KiReadTable!\", end_position: Some(Position { row: 4, column: 1, file: \"\" }), issue_code: 0, severity: 1, issues: [IssueMessage { position: Some(Position { row: 4, column: 1, file: \"\" }), message: \"Cannot find table 'db.[/local/test2]' because it does not exist or you do not have access permissions. Please check correctness of table path and user permissions.\", end_position: Some(Position { row: 4, column: 1, file: \"\" }), issue_code: 2003, severity: 1, issues: [] }] }] }], result: Some(Any { type_url: \"type.googleapis.com/Ydb.Table.ExecuteQueryResult\", value: [18, 0] }), metadata: None, cost_info: None }" })

Looks like example should create table test2 before insert.

Thanks!

Binding Option<DateTime<Utc>> cause convertation error from Timestamp to DateTime

Having table field: token_expires_at of type Option<DateTime>.
When trying to bind value to it while inserting new record getting error:

[YdbIssue { issue_code: 0, message: "Failed to convert type: Struct<.....................,'token_expires_at':Timestamp,...............> to Struct<....................,'token_expires_at':Datetime?,.............................>

It is required to check bindings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.