localDBConn: Create a connection that can be used to run queries on a...

View source: R/querymi.R

localDBConnR Documentation

Create a connection that can be used to run queries on a local GCAM database

Description

Given a directory in which a GCAM database is located and the name of the database, return a connection that can be used to run queries on the database.

Usage

localDBConn(
  dbPath,
  dbFile,
  miclasspath = NULL,
  migabble = TRUE,
  validatedb = TRUE,
  maxMemory = "4g"
)

Arguments

dbPath

The path in which the BaseX DBs are located.

dbFile

GCAM database to extract scenario from.

miclasspath

Java class path for the GCAM Model Interface.

migabble

If TRUE, discard model interface console output. If FALSE, display console output.

validatedb

If TRUE, check that a simple db query works on the connection; otherwise, don't run the check.

maxMemory

Sets the maximum memory for Java which will be used to run the queries. The default value is "4g". Users may need to reduce this value if they are using a 32-bit Java or increase it if they suspect they are running out of memory (by using migabble to check the log). Note the numeric value can be suffixed with "g" for Gigabyte or "m" for Megabyte.

Details

By default, the a version of the GCAM ModelInterface and BaseX libraries supplied with the package will be used to run the query. You can replace these by specifying a Java classpath minimally including the replacement ModelInterface.jar and BaseX.jar files.

Value

A connection to a local BaseX databasse which can be used to run queries.


JGCRI/rgcam documentation built on July 2, 2022, 10:20 a.m.