Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
DBI
 
 
 
 
RH2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

R DBI interface and various database interfaces for Renjn.

Example usage:

MonetDB

library(MonetDB.R)
con <- dbConnect(MonetDB.R(), url="jdbc:monetdb://localhost:50000/somedatabase", username="monetdb", password="monetdb")
df  <- dbGetQuery(con, "SELECT * from sometable")

MySQL/MariaDB

library(RMySQL)
con <- dbConnect(RMySQL(), url="jdbc:mysql://localhost:3306/somedatabase", username="someuser", password="somepass")
df  <- dbGetQuery(con, "SELECT * from sometable")

Oracle ®

library(ROracle)
con <- dbConnect(ROracle(), url="jdbc:oracle:thin:@localhost", username="someuser", password="somepass")
df  <- dbGetQuery(con, "SELECT * from sometable")

PostgreSQL

library(RPostgreSQL)
con <- dbConnect(RPostgreSQL(), url="jdbc:postgresql://localhost:5432/somedatabase", username="someuser", password="somepass")
df  <- dbGetQuery(con, "SELECT * from sometable")

SQLite

library(RSQLite)
con <- dbConnect(RSQLite(), url="jdbc:sqlite:", username="", password="")
df  <- dbGetQuery(con, "SELECT * from sometable")

H2 database

library(RH2)
con <- dbConnect(RH2(), url="jdbc:h2:file:/tmp/mydb", username="", password="")
df  <- dbGetQuery(con, "SELECT * from sometable")

H2GIS database

library(RH2GIS)
con <- dbConnect(RH2GIS(), url="jdbc:h2:file:/tmp/mydb", username="sa", password="")
loadSpatialFunctions(con)
#Create a table with a geometry column
dbSendQuery(con,"CREATE TABLE VANNES (the_geom geometry, id int)")
#Insert a polygon
dbSendQuery(con,"INSERT INTO VANNES VALUES('POLYGON ((100 300, 210 300, 210 200, 100 200, 100 300))'::geometry, 1)"); 
#Run a spatial function
df  <- dbGetQuery(con,"SELECT ST_AREA(the_geom) as area FROM VANNES")

About

DBI interface and various database interfaces for Renjn

Resources

License

Releases

No releases published

Packages

No packages published