This is a wrapper to query sqlite_master from the sqlite database.

sqlite_master_to_df(conn, temp = FALSE)

Arguments

conn

An object of class SQLiteConnection to a sqlite database.

temp

Should sqlite_temp_master be queried, instead of sqlite_master? Default is FALSE. This can be useful when looking for temporary tables and indexes on them.

Value

A dataframe with type, name, tbl_name and sql statement from sqlite_master.

Examples

conn <- connect_to_db(db_example("AcademicGraph.sqlite"))
#> The database connection is: 
#> src:  sqlite 3.38.5 [/tmp/RtmptPxKJr/temp_libpath72cc939d74f39/magutils/extdata/AcademicGraph.sqlite]
#> tbls: AuthorAffiliation, FieldsOfStudy, FirstNamesGender, author_coauthor,
#>   author_output, current_links, current_links_advisors, pq_advisors,
#>   pq_authors, pq_fields_mag, pq_unis
dplyr::glimpse(sqlite_master_to_df(conn))
#> Rows: 30
#> Columns: 4
#> $ type     <chr> "table", "index", "index", "table", "index", "index", "table"…
#> $ name     <chr> "current_links", "idx_t_AuthorIdgoid", "idx_t_goid", "current…
#> $ tbl_name <chr> "current_links", "current_links", "current_links", "current_l…
#> $ sql      <chr> "CREATE TABLE `current_links` (\n  `AuthorId` INTEGER,\n  `go…