-
Notifications
You must be signed in to change notification settings - Fork 73
Connections Pane
The Connections Pane allows you to explore database connections created within your R or Python sessions. It also includes basic support for storing and managing connection strings for future usage.
To open a connection in Positron Connections Pane, you just need to connect to a database using using any
package that supports the connections contract, such as odbc
, sparklyr
,
bigrquery and others.
The Positron Connections Pane implements RStudio's connections contract, this means that any package that works within RStudio's Connections Pane should work within the Positron Connections Pane.
Here is an example of how to open a connection using the connections
package to open a SQLite connection:
tmp <- tempfile()
dir.create(tmp)
dbplyr::nycflights13_sqlite(path = tmp)
con <- connections::connection_open(RSQLite::SQLite(), file.path(tmp, "nycflights13.sqlite"))
You can find more information about connecting to an specific database by following this link.
Currently we only support connections created using sqlite3
and SQLAlchemy
modules.
To open a connection in the connections pane, create a top level object that represents the connection/engine.
import sqlite3
conn = sqlite3.connect("nycflights13.sqlite")
You can then either use %connection_show conn
to open the connection in the connections pane or click in
the database icon that appears close to the object name in the variables pane.
That should bring up the connections pane, allowing you to navigate the database.