Skip to content
master
Go to file
Code
This branch is 1 commit ahead of jamiefolson:master.

Latest commit

 

Git stats

Files

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

README.md

This package is an attempt to bring programmatic query construction as in SQLAlchemy to R. Tables are represented as S4 objects, with the $ operator overloaded to allow query construction:

> library(rsql)
> tab = rsql_table('test',c('x','y','z'))
> to_sql(tab$select())
[1] "SELECT test.x AS x,\n\ttest.y AS y,\n\ttest.z AS z\nFROM test"
> writeLines(to_sql(tab$select()))
SELECT test.x AS x,
  test.y AS y,
  test.z AS z
FROM test
> writeLines(to_sql(tab$select(.(a=x,b=y>5))$where(from(tab,.(z <5)))))
SELECT test.x AS a,
  test.y > 5 AS b
FROM test
WHERE test.z < 5

An ever-expanding list of SQL expressions are supported. For me information see the package documentation, especially for the rsql function.

About

An R package for programmatic construction of SQL, similar to SQLAlchemy

Resources

License

Releases

No releases published

Packages

No packages published

Languages