chinook <- dbi.catalog(chinook.duckdb)
#The Album table has a foreign key constriant that references Artist
merge(chinook$main$Album, chinook$main$Artist)
#When y is omitted, x's foreign key relationship is used to determine y
merge(chinook$main$Album)
#Multiple foreign keys are supported
csql(merge(chinook$main$Track))
#Track references Album but not Artist, Album references Artist
#This dbi.table includes Artist.Name as well
csql(merge(chinook$main$Track, recursive = TRUE))
Run the code above in your browser using DataLab