query-functions: query functions

Description Examples

Description

**query functions** are dynamic functions which connect to a database, execute queries in it and transform data. Actually it is a decorator for query function. query has 5 arguments. The first argument is an instance of the sqliter class and the second is the database name. The call to a query function is executed like a method call to the sqliter object through the $ operator. The function name must have the following pattern: query_<database name without extension>. This call returns an query function with the first 2 argument already set. The first parameter is the sqliter object on which the $ operator have been called and the second argument is extracted from the query function name, the name after the preffix query_.

Examples

1
2
3
4
5
## Not run: 
DBM <- sqliter(path=c("data", "another/project/data"))
DBM$query_dummydatabase("select count(*) from dummytable")

## End(Not run)

wilsonfreitas/sqliter documentation built on May 4, 2019, 6:28 a.m.