Skip to contents

Validates the URL, loads the azure and delta extensions, then registers the table either as an ATTACH database or a VIEW. Use az_conn() first if the connection needs an Azure secret. Returns conn invisibly — use tbl_delta() if you want a dplyr::tbl().

Usage

load_delta(
  conn,
  url,
  name,
  method = c("attach", "view"),
  replace = TRUE,
  version = NULL,
  timestamp = NULL
)

Arguments

conn

A DuckDB connection.

url

Character scalar. Azure Blob URL pointing to a Delta table.

name

Character scalar. Name to register the table under in DuckDB.

method

"attach" (default) or "view".

replace

Logical. Replace an existing registration. Default TRUE.

version

Optional non-negative Delta table version to attach.

timestamp

Deprecated. Not supported: DuckDB's delta extension accepts a TIMESTAMP attach option but ignores it, returning the latest snapshot. Supplying it raises an error. Use version instead.

Value

Invisibly returns conn.

Examples

if (FALSE) { # \dontrun{
# Requires a live Azure account, credentials, and network access.
conn <- az_conn()
load_delta(conn, "abfss://container@account/path/sales", name = "sales")
DBI::dbGetQuery(conn, "SELECT COUNT(*) FROM sales")
} # }