# Dataset$connect\_dbi

### **Dataset$**<mark style="color:purple;">**connect\_dbi**</mark>**()** → [DBI::DBIConnection](https://dbi.r-dbi.org/reference/DBIConnection-class.html)

Returns a DBI connection that can be used by dbplyr and other interfaces that work with DBI. This connection is scoped to the respective dataset, avoiding the need to fully qualify tables.

{% hint style="info" %}
For advanced use cases, you can also access the Redivis DBI interface at `redivis::RedivisDBI`. `dataset$connect_dbi()` is the same as calling: `DBI::dbConnect(redivis::RedivisDBI(dataset=dataset))`
{% endhint %}

### **Returns:**

[**DBI::DBIConnection**](https://dbi.r-dbi.org/reference/DBIConnection-class.html)

### Examples

```r
con <- redivis$dataset("demo.ghcn_daily_weather_data")$connect_dbi()

tbl(con, "stations") |> filter(latitude > 0) |> collect()

# Prints a tibble with the relevant weather stations
```
