dolt_local() creates a DoltLocalDriver, which can generate a DoltLocalConnection. Unlike dolt_remote() and DoltDriver, local connections are for dolt databases stored in directories on-disk, and take a directory name as an argument. The local connection type starts and manages a dolt SQL server in the background serving that directory, connects to it and returns the connection. Parameters govern both the server and connection

Local dolt connection objects contain additional slots including the database path on-disk and an external pointer to the server process, and these are returned via dbGetInfo and displayed in the connection print method. The dbDisconnect method kills the background server if no other processes are connected to it.

Multi-user or other, more complicated networking set-ups should use dolt_server() and dolt_remote() directly.

dolt_local()

# S4 method for DoltLocalDriver
dbUnloadDriver(drv, ...)

# S4 method for DoltLocalDriver
show(object)

# S4 method for DoltLocalDriver
dbConnect(
  drv,
  dir = Sys.getenv("DOLT_DIR", "doltdb"),
  username = Sys.getenv("DOLT_USERNAME", "root"),
  password = Sys.getenv("DOLT_PASSWORD", ""),
  port = Sys.getenv("DOLT_PORT", 3306L),
  host = Sys.getenv("DOLT_HOST", "127.0.0.1"),
  find_port = TRUE,
  find_server = TRUE,
  autocommit = TRUE,
  server_args = list(),
  ...
)

# S4 method for DoltLocalConnection
dbGetInfo(dbObj, ...)

# S4 method for DoltLocalConnection
show(object)

# S4 method for DoltLocalConnection
dbDisconnect(conn, ...)

# S4 method for DoltLocalConnection
dbIsValid(dbObj, ...)

Arguments

drv

an object of class DoltLocalDriver, created by dolt_local().

...

additional arguments to pass to RMariaDB

object

a connection object

dir

The dolt directory to serve and connect to

username

The username. Defaults to "root"

password

The login password. Defaults to empty.

port

The TCP port for connections. Defaults to 3306.

host

The IP of the host. Defaults to the local machine, 127.0.0.1

find_port

whether to find an open port if the default is used by another process

find_server

whether to look for another server process serving the same directory before creating a new one

autocommit

Whether to autocommit changes in the SQL sense. That is, to flush pending changes to disk and update the working set.

server_args

a list of additional arguments to pass to dolt_server()

dbObj

the database connection

conn

the database connection

See also

Other connections: dolt_remote(), dolt()