-
Notifications
You must be signed in to change notification settings - Fork 1
Driver: Add page about Rust #407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
surister
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌋👍
About
What the title says.
Preview
https://cratedb-guide--407.org.readthedocs.build/connect/rust/