Conversation
WalkthroughAdds Rust driver documentation and integrates it into the Connect drivers landing: new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Developer
participant Docs as "Docs (connect/rust/index.md)"
participant App as "Rust App"
participant CrateDB as "CrateDB (Postgres protocol)"
rect #E6F5FF
Developer->>Docs: open examples & cargo commands
Docs-->>Developer: show code samples and instructions
end
rect #F0FFE6
Developer->>App: run localhost example
App->>CrateDB: connect tcp:5432 (no TLS)
CrateDB-->>App: query results
App-->>Developer: print results
end
rect #FFF5E6
Developer->>App: run Cloud TLS example
App->>CrateDB: connect tcp:+TLS (native-tls)
CrateDB-->>App: query results (TLS)
App-->>Developer: print results
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6bab9df to
4d87608
Compare
d21e2b4 to
fee1eab
Compare
surister
left a comment
There was a problem hiding this comment.
Code runs fine, I'd add how to do proper pooling but we can add that in later patches,
e.g.
use postgres::{NoTls, Row};
use r2d2_postgres::{
r2d2::{ManageConnection, Pool},
PostgresConnectionManager,
};
fn main {
let pg_manager = PostgresConnectionManager::new(
"postgres://postgres:postgres@localhost:5432"
.parse()
.unwrap(),
NoTls,
);
let pg_pool = Pool::builder()
.max_size(5)
.build(pg_manager)
.expect("Postgres pool failed");
let mut pg_conn = pg_pool.get().unwrap();
let result = pg_conn.query("select point_, linestring_ from pgis_datatypes", &[]);
let rows = result.unwrap().into_iter().collect::<Vec<Row>>();
}|
Excellent. I've added your snippet right away. |
About
What the title says.
Preview
https://cratedb-guide--407.org.readthedocs.build/connect/rust/