Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list sqlite tables with dplyr?

Tags:

r

dplyr

I can use dplyr to connect to a sqlite database:

library(dplyr)
mydb<- src_sqlite("DATA/mydb.db")

How can I list the tables in mydb? I couldn't find anything about that in the help file

like image 344
Ignacio Avatar asked Aug 28 '15 12:08

Ignacio


1 Answers

# get sample databases from: http://chinookdatabase.codeplex.com/

library(dplyr)
mydb <- src_sqlite("Chinook_Sqlite.sqlite")
src_tbls(mydb)

##  [1] "Album"         "Artist"        "Customer"      "Employee"    
##  [5] "Genre"         "Invoice"       "InvoiceLine"   "MediaType"    
##  [9] "Playlist"      "PlaylistTrack" "Track"        
like image 84
hrbrmstr Avatar answered Nov 02 '22 10:11

hrbrmstr