Skip to contents

Drops every table or view whose name starts with __il_ from a DBI connection. This is intended as an explicit interactive escape hatch after failed runs or exploratory sessions. Prefer il_cleanup() when cleaning up a specific live model on a shared connection.

Usage

il_cleanup_all(con)

Arguments

con

A DBI connection from DBI::dbConnect().

Value

con, invisibly.

Examples

df <- data.frame(
  unique_id = 1:4,
  name = c('Ann', 'Anne', 'Bob', 'Rob')
)
con <- DBI::dbConnect(duckdb::duckdb())
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#>  /tmp/Rtmpye6umx/duckdb
#> This is removed when the R session ends.
#>  Extensions are re-downloaded each session.
#>  Secrets are lost.
#>  Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#>  Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#>  See ?duckdb_storage for details and alternatives.
spec <- il_spec() |>
  il_compare(name, cl_jaro_winkler(0.9)) |>
  il_block_on(name)
model <- il_model(df, spec = spec, con = con)

il_cleanup_all(con)
DBI::dbDisconnect(con, shutdown = TRUE)