mikhailnazarov / ydb-rs-sqlx Goto Github PK
View Code? Open in Web Editor NEWSqlx integration for YDB rust SDK
License: Apache License 2.0
Sqlx integration for YDB rust SDK
License: Apache License 2.0
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")
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!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.