-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Unexpected result when running existsTable on connection created with createDbiConnectionDetails and supplying a databaseSchema. It does work when I provide it the '@dbiConnection':
connectionDetails <- DatabaseConnector::createDbiConnectionDetails(
dbms = "postgresql",
drv = RPostgres::Postgres(),
dbname = Sys.getenv("CDM5_POSTGRESQL_DBNAME"),
host = Sys.getenv("CDM5_POSTGRESQL_HOST"),
user = Sys.getenv("CDM5_POSTGRESQL_USER"),
password = Sys.getenv("CDM5_POSTGRESQL_PASSWORD")
)
connection <- DatabaseConnector::connect(connectionDetails)
DatabaseConnector::existsTable(connection, tableName = 'achilles_results', databaseSchema = 'results')
#> [1] FALSE
DatabaseConnector::existsTable(connection@dbiConnection, tableName = 'achilles_results', databaseSchema = 'results')
#> [1] TRUE
is(connection, "DatabaseConnectorConnection")
#> [1] TRUE
DatabaseConnector::disconnect(connection)Created on 2026-02-20 with reprex v2.1.1
Relevant line in function. listTables for dbi connection returns tables in public schema:
DatabaseConnector/R/ListTables.R
Lines 117 to 119 in 68ef37d
| } else if (is(connection, "DatabaseConnectorConnection")) { | |
| tableNames <- DBI::dbListTables(conn = connection, databaseSchema = databaseSchema) | |
| } else if (is(connection, "PqConnection") || is(connection, "RedshiftConnection") || is(connection, "duckdb_connection")) { |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels