Learn R Programming

MonetDBLite (version 0.2.2)

embedded: MonetDBLite low-level interface

Description

Low-level API for MonetDBLite. DBI/dplyr frontends for these functions is in the MonetDB.R package. This package is not really meant to be used directly.

Usage

monetdb_embedded_startup(dir=tempdir(), quiet = TRUE, sequential = TRUE)
monetdb_embedded_connect()
monetdb_embedded_query(conn, query, execute = TRUE, resultconvert = TRUE)
monetdb_embedded_append(conn, table, tdata, schema = "sys")
monetdb_embedded_disconnect(conn)
monetdb_embedded_shutdown()

Arguments

dir
Path to the directory where the database will be created. Must be writeable or createable.
quiet
Suppress MonetDB startup messages?
sequential
Disable intra-query parallelization
conn
Connection as obtained by calling monetdb_embedded_connect()
query
SQL query, DDL statement or transaction statement
execute
Actually execute query?
resultconvert
Convert results to R vectors?
table
Database table name
tdata
data.frame with columns matching the schema of table
schema
Schema name

Value

  • monetdb_embedded_startup returns TRUE if successful. monetdb_embedded_query returns a list with query results which might contain a data.frame with results or an error message string. monetdb_embedded_query returns TRUE if successful or a string with an error message if not.

Examples

Run this code
monetdb_embedded_startup(tempdir())
conn <- monetdb_embedded_connect()
monetdb_embedded_query(conn, "SELECT * FROM tables;")
monetdb_embedded_query(conn, "CREATE TABLE foo(i INTEGER, j INTEGER)")
monetdb_embedded_append(conn, "foo", data.frame(i=1:10, j=21:30))
monetdb_embedded_disconnect(conn)
monetdb_embedded_shutdown()

Run the code above in your browser using DataLab