Skip to contents

Setup and Connection

Initialize and manage DuckLake connections

install_ducklake()
Install the ducklake extension to duckdb
attach_ducklake()
Create or attach a ducklake
detach_ducklake()
Detach from a ducklake
get_ducklake_connection()
Get the DuckDB connection used by ducklake
set_ducklake_connection()
Use your own DuckDB connection with ducklake
get_ducklake_backend()
Get the catalog backend type of an attached lake
create_storage_secret()
Store object storage credentials for a session

Table Operations

Create and query tables

create_table()
Create a DuckLake table
get_ducklake_table()
Get a DuckLake table
replace_table()
Replace a table with modified data and create a new snapshot
add_data_files()
Register existing Parquet files with a DuckLake table
create_view()
Create a DuckLake view from a dplyr pipeline
drop_view()
Drop a DuckLake view
list_ducklake_tables()
List the tables and views in a DuckLake catalog

Row Operations

Modify table rows with dplyr-style functions

rows_insert()
Insert rows into a DuckLake table
rows_update()
Update rows in a DuckLake table
rows_delete()
Delete rows from a DuckLake table
rows_upsert()
Upsert rows into a DuckLake table
merge_into()
Merge a source table into a DuckLake table

Schema Evolution

Change a table’s shape in place, preserving history

add_table_column()
Add a column to a DuckLake table
drop_table_column()
Drop a column from a DuckLake table
rename_table_column()
Rename a column in a DuckLake table
set_column_type()
Change the type of a DuckLake table column
rename_ducklake_table()
Rename a DuckLake table

Query Execution

Execute and preview SQL queries

ducklake_exec()
Execute DuckLake operations from dplyr queries
show_ducklake_query()
Show the SQL that would be executed by ducklake operations

Transactions

ACID transaction support

with_transaction()
Execute code within a transaction
begin_transaction()
Begin a transaction
commit_transaction()
Commit a transaction
rollback_transaction()
Rollback a transaction

Time Travel

Query and restore historical data

get_ducklake_table_asof()
Query a table at a specific timestamp (time travel)
get_ducklake_table_version()
Query a table at a specific version/snapshot
get_table_changes()
Get the changes made to a table between two snapshots
list_table_snapshots()
List available snapshots for a table
plot_snapshots()
Plot the snapshot history of a table or lake
plot_table_changes()
Plot the rows changed in each snapshot of a table
restore_table_version()
Restore a table to a previous version

Table Documentation

Comments and variable labels stored in the lake

set_table_comment()
Set the comment on a DuckLake table
set_column_comments()
Set column comments on a DuckLake table
get_table_comments()
Read table, view, and column comments from a DuckLake catalog

Metadata

Access metadata and snapshots

get_metadata_table()
Get a DuckLake metadata table
set_snapshot_metadata()
Set metadata for the most recent snapshot

Data Inlining

Configure and manage data inlining for streaming workloads

set_inlining_row_limit()
Set the data inlining row limit
get_inlining_row_limit()
Get the current data inlining row limit
flush_inlined_data()
Flush inlined data to Parquet files
checkpoint_ducklake()
Run a DuckLake checkpoint

Partitioning and Sorting

Manage partition keys and sort orders for file pruning

set_table_partitioning()
Set partitioning keys for a table
reset_table_partitioning()
Remove partitioning keys from a table
get_table_partitions()
List the partitioning keys of tables in a lake
set_table_sorting()
Set the sort order of a table
reset_table_sorting()
Remove the sort order from a table

Options

Lake, schema, and table configuration

set_ducklake_option()
Set a DuckLake option
get_ducklake_options()
List the options set on a DuckLake

Backup and Maintenance

Backup, compaction, and storage reclamation

backup_ducklake()
Create a DuckLake backup
expire_snapshots()
Expire old snapshots
merge_adjacent_files()
Merge adjacent Parquet files
cleanup_old_files()
Delete files scheduled for removal
delete_orphaned_files()
Delete orphaned files
rewrite_data_files()
Rewrite data files with many deletes
get_table_info()
Get file statistics for the tables in a lake
plot_table_files()
Plot the file layout of a lake
list_ducklake_files()
List the data files backing a DuckLake table

Quack remote access

Connect to and serve DuckLake over the Quack protocol

install_quack()
Install the Quack extension
attach_quack()
Connect to a remote Quack server
detach_quack()
Disconnect from a remote Quack server
quack_query()
Run a one-off query against a remote Quack server
quack_serve()
Serve the current session over Quack
quack_stop()
Stop a Quack server