Return all primary key columns as guess at preferred primary keys for a SQLite handle.

key_inspector_sqlite(db, tablename)

Arguments

db

database handle

tablename

character, name of table

Value

map of keys to keys

See also

describe_tables

Examples

if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") DBI::dbExecute(my_db, " CREATE TABLE orgtable ( eid TEXT, date INTEGER, dept TEXT, location TEXT, PRIMARY KEY (eid, date) ) ") print(key_inspector_sqlite(my_db, "orgtable")) DBI::dbDisconnect(my_db) }
#> eid date #> "eid" "date"