Skip to content

connect shiny to pg #1

@jjyh

Description

@jjyh

RPostgreSQL depends on DBI, which means you cannot have the first work without the second. DBI provides a basic interface but can connect to no databases. The "drivers" for each DBMS are provided by individual packages, such as RPostgreSQL, RPostgres (diff implementation), RSQLite, RMySQL
The reason you see some functions written in both packages is that DBI provides default implementation that either does nothing or more likely does the basic act; some DBMS deviate from the standard or have more-efficient ways of doing things, so they override the default. –
So in my use, I never load the actual driver package, since I only refer to it when I do DBI::dbConnect(RPostgres::Postgres(), ...). I generally do use library(DBI), and tend to use those methods.
Use DBI functions, there should be no need to do library(RPostgreSQL). Whether you use DBI::dbConnect or dbConnect (after library(DBI)) is a personal preference
https://stackoverflow.com/questions/53795181/difference-between-dbi-package-and-rpostgresql-packages-in-r

CRUD shiny
https://community.rstudio.com/t/building-crud-with-shiny/2881/9

rpostgres
https://appsilon.com/r-shiny-postgres-database/

https://stackoverflow.com/questions/58270888/save-shiny-dataframe-to-postgresql-database

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions