Skip to contents

The list_shares() function provides a convenient wrapper around the MotherDuck SQL command LIST SHARES;. It validates that the supplied connection is an active MotherDuck connection before executing the query. If the connection is not valid, the function returns 0 instead of a table.

Usage

list_shares(.con)

Arguments

.con

A valid DBI connection (DuckDB / MotherDuck).

Value

A tibble::tibble containing details of available shares if the connection is an MD connection or an empty tibble if not

Details

MotherDuck supports object sharing, which allows users to list and access data shared between accounts. This function helps programmatically inspect available shares within an authenticated MotherDuck session.

Examples

if (FALSE) { # \dontrun{
# Connect to MotherDuck
con <- DBI::dbConnect(duckdb::duckdb())

# List shares
list_shares(con)

# Disconnect
DBI::dbDisconnect(con)
} # }