Connects to a PostgreSQL database, executes a SQL query, and returns the
result as a tidylearn_data object. Accepts either a connection string
or individual connection parameters. Requires DBI and RPostgres.
Arguments
- dsn
A PostgreSQL connection string (e.g.,
"postgres://user:pass@host:port/dbname"), or the database host if using named parameters.- query
A SQL query string.
- dbname
Database name (if not in
dsn).- user
Username (if not in
dsn).- password
Password (if not in
dsn).- port
Port number. Default is 5432.
- ...
Additional arguments passed to
DBI::dbConnect().
