IT, in their infinite wisdom, built us a Snowflake database. In this database, there are several schema, and across schema there are duplicate table names, hundreds of them. I have functions that pull lists of tables from a database (dbListTables()), but now I need to pull them from only a specific schema.
I can use the following code to get tables out of a schema:
dbListObjects(myDB, Id("schema_name"))
This works fine, but it returns a data frame with an AsIs variable for the table names, it looks like this:
"<Id> table = TABLENAME"
To get the actual table name, I have to convert it to a character variable:
as.character(var) --> "new("Id", name = c(table = "TABLENAME"))"
I can extract the table name from that. But what a pain in the ass. Can someone help me find an easier way to get the table names out of a schema?