parseDatabaseUri: Parse a string containing the information for connecting to a...

View source: R/utils.R

parseDatabaseUriR Documentation

Parse a string containing the information for connecting to a database

Description

Given a string of the format "database_driver://host/database_name", pull out the 3 pieces of information and return them as a named list.

Usage

parseDatabaseUri(database.uri)

Arguments

database.uri

A string of the format "database_driver://host/database_name"

Value

A named list containing the driver, host, and database name from the supplied string

Examples


# Parse a URI for a local PostgreSQL database called "gtf"
parsed.URI <- parseDatabaseUri("postgres://localhost/gtf")

# Parse a URI for the included SQLite database "vrk2.neighborhood.hg38.gtfAnnotation.db" in the local documents folder
db.address <- system.file(package="trena", "extdata")
genome.db.uri    <- paste("sqlite:/", db.address, "vrk2.neighborhood.hg38.gtfAnnotation.db",  sep = "/")
parsed.URI <- parseDatabaseUri(genome.db.uri)


PriceLab/TReNA documentation built on March 21, 2023, 1:57 p.m.