Skip to content

Conversation

@amotl
Copy link
Member

@amotl amotl commented Oct 16, 2025

@amotl amotl added the cross linking Linking to different locations of the documentation. label Oct 16, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Walkthrough

Adds Rust driver documentation and integrates it into the Connect drivers landing: new docs/connect/rust/index.md, a Rust driver card and toctree entry in docs/connect/index.md, and a linkcheck ignore entry in docs/conf.py.

Changes

Cohort / File(s) Change Summary
Drivers landing
docs/connect/index.md
Inserted a Rust driver card into the "Drivers by language" grid (connect-rust link), including Rust FAB icon, styling/alt text, and added rust/index to the drivers toctree (positioned after Ruby).
Rust driver guide
docs/connect/rust/index.md
Added new Rust connection guide with localhost (postgres crate) and CrateDB Cloud (TLS with native-tls + postgres-native-tls) examples, a connection-pooling example (r2d2_postgres), Cargo init/add/run commands, example repo link, badges, and references to shared _cratedb.md setup.
Doc config
docs/conf.py
Appended a comment and added r"https://crates.io/crates/" to linkcheck_ignore to avoid linkcheck 404 errors.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to:
    • docs/connect/index.md — verify markup, grid alignment, icon/alt text, and toctree ordering.
    • docs/connect/rust/index.md — spot-check code blocks, Cargo dependency lines, TLS examples, and example repo link.
    • docs/conf.py — ensure the added linkcheck_ignore entry and comment are correctly formatted.

Possibly related PRs

Suggested labels

new content

Suggested reviewers

  • kneth
  • surister

Poem

🐇 I hopped into docs with code in paw,
New Rusty cards to show and draw,
Cargo commands and TLS delight,
Pools and queries run just right,
Hooray — the guide is ready to gnaw!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Driver: Add page about Rust" directly and specifically describes the main change in the changeset. The modifications add a new Rust driver documentation page (docs/connect/rust/index.md), register it in the driver index (docs/connect/index.md), and update configuration files to support it. The title clearly communicates this primary change in concise language that a teammate scanning history would immediately understand.
Description Check ✅ Passed The PR description is minimal but related to the changeset. It acknowledges the title's summary and provides a preview link to the generated documentation page (https://cratedb-guide--407.org.readthedocs.build/connect/rust/), which directly corresponds to the new Rust driver documentation being added. While brief, the description is clearly related to the changeset and not off-topic.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rust

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl requested review from kneth and surister October 16, 2025 11:15
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl force-pushed the rust branch 3 times, most recently from 6bab9df to 4d87608 Compare October 21, 2025 12:27
coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl force-pushed the rust branch 2 times, most recently from d21e2b4 to fee1eab Compare October 26, 2025 19:52
Copy link
Member

@surister surister left a 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>>();
}

coderabbitai[bot]

This comment was marked as resolved.

@amotl
Copy link
Member Author

amotl commented Oct 30, 2025

Excellent. I've added your snippet right away.

@amotl amotl requested a review from surister October 30, 2025 13:36
coderabbitai[bot]

This comment was marked as spam.

Copy link
Member

@surister surister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌋👍

@amotl amotl merged commit 6ef920c into main Oct 30, 2025
3 checks passed
@amotl amotl deleted the rust branch October 30, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cross linking Linking to different locations of the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants