Skip to content

Conversation

@amotl
Copy link
Member

@amotl amotl commented Oct 16, 2025

About

We found out that RPostgres is the canonical driver, while RPostgreSQL is becoming more and more outdated.

References

@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Two new PostgreSQL example scripts are added to the R directory demonstrating connections via RPostgres and RPostgreSQL drivers. The Makefile is updated to execute all three R scripts in the test target. Documentation in README is revised to reference both driver examples.

Changes

Cohort / File(s) Summary
Build configuration
by-language/r/Makefile
Test target now sequentially executes three R scripts: basic.r, basic_rpostgres.r, and basic_rpostgresql.r instead of only basic.r
Documentation
by-language/r/README.md
Updated to describe new RPostgres and RPostgreSQL examples, changed "Invoke example program" to "Invoke example programs", replaced single basic.r references with both new scripts, added external links for both drivers
Implementation
by-language/r/basic_rpostgres.r, basic_rpostgresql.r
Two new example scripts demonstrating PostgreSQL connections: basic_rpostgres.r uses RPostgres with DBI, basic_rpostgresql.r uses RPostgreSQL with driver instantiation via RPostgreSQL::PostgreSQL() and explicit cleanup via on.exit

Sequence Diagram

sequenceDiagram
    participant Script as R Script
    participant DBI as DBI/Driver
    participant DB as PostgreSQL
    
    rect rgb(200, 220, 255)
    Note over Script,DB: RPostgres Flow
    Script->>Script: Conditionally install RPostgres
    Script->>DBI: Load DBI & RPostgres
    Script->>DBI: dbDriver("postgres")
    DBI-->>Script: Driver
    end
    
    Script->>DB: Connect to localhost:5432
    DB-->>Script: Connection object
    
    rect rgb(220, 200, 255)
    Note over Script,DB: Query & Operations
    Script->>DB: SELECT from sys.summits
    DB-->>Script: Results
    Script->>DB: CREATE TABLE r if not exists
    Script->>DB: INSERT row
    Script->>DB: SELECT from r
    DB-->>Script: Results
    end
    
    Script->>DB: Disconnect (on.exit)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Two drivers hop through PostgreSQL's door,
RPostgres and RPostgreSQL explore,
With connections and queries, we fetch and we store,
New examples for R, now there's so much more! 🚀

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "R: Extend example to demonstrate both RPostgres and RPostgreSQL" is directly related to the main changes in the changeset. The raw summary clearly shows that the PR adds two new R scripts (basic_rpostgres.r and basic_rpostgresql.r), updates the Makefile to run both scripts, and modifies the README to reflect these additions. The title is concise, clear, and specific enough that reviewers scanning the history would immediately understand that the primary change is expanding the R examples to cover both drivers. The title avoids vague terminology and file lists, making it effective at conveying the purpose of the changes.
Description Check ✅ Passed The pull request description is adequately related to the changeset. It explains the motivation behind the changes by noting that RPostgres is the canonical driver while RPostgreSQL is becoming outdated, which provides meaningful context for why both drivers are being demonstrated in the examples. The description includes a reference to a related pull request, and while it does not provide extensive technical details about the implementation, the lenient evaluation criteria only require that the description be related in some way to the changeset—not that it be comprehensive. The description clearly satisfies this requirement.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

@amotl amotl marked this pull request as ready for review October 16, 2025 23:14
@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Comment on lines 28 to 32
# Delete testdrive table when needed.
# FIXME: https://github.com/crate/crate/issues/18528
#if (dbExistsTable(conn, "r")) {
# dbRemoveTable(conn, "r")
#}
Copy link
Member Author

@amotl amotl Oct 20, 2025

Choose a reason for hiding this comment

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

Re-enable this with CrateDB 6.2.0. Will also available per nightly release starting this night.

Copy link
Member Author

Choose a reason for hiding this comment

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

This spot started working with CrateDB Nightly today, covering it successfuly also with the RPostgres driver now. Thank you for the quick turnaround, @mfussenegger.

@amotl amotl merged commit bc8c07e into main Oct 21, 2025
2 checks passed
@amotl amotl deleted the r-more branch October 21, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants