# redivis$connect\_dbi

### **redivis$**<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 tha work with DBI. This connection will be globally scoped, and all table names must be appropriately qualified.

To create a connection scoped to particulary dataset or workflow, see:

* [Dataset$connect\_dbi()](/api/client-libraries/redivis-r/reference/dataset/datasetusdconnect_dbi.md)
* [Workflow$connect\_dbi()](/api/client-libraries/redivis-r/reference/workflow/workflowusdconnect_dbi.md)

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

### **Returns:**

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

### Examples

```r
con <- redivis$connect_dbi()

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/redivis/redivisusdconnect_dbi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
