| schema_from_db | R Documentation |
Returns a data frame describing the columns of a database table.
schema_from_db(conn, table, level = c("medium", "low", "high"))
conn |
A DBI connection. |
table |
Character scalar: table name to introspect. |
level |
Privacy preset to annotate in schema metadata: one of "low", "medium", "high". Default "medium". |
A data.frame with column metadata (e.g., name, type).
if (requireNamespace("DBI", quietly = TRUE) &&
requireNamespace("RSQLite", quietly = TRUE)) {
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
on.exit(DBI::dbDisconnect(con), add = TRUE)
DBI::dbWriteTable(con, "mtcars", mtcars[1:3, ])
sc <- schema_from_db(con, "mtcars")
head(sc)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.