Database Independent Interface (DBI) makes connecting to and getting data from various relational databases from R very easy and efficient.
To use DBI, we load DBI first:
library(DBI)
We then create an in-memory RSQLite database:
con <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")
We can print a list of tables as follows:
dbListTables(con)