use of com.github.mgramin.sqlboot.model.resource_type.wrappers.list.WhereWrapper in project sql-boot by sql-boot.
the class SqlResourceTypeTest method read2.
@Test
public void read2() {
final String sql = "select * from (select table_schema as \"@table_schema\", table_name as \"@table_name\", column_name as \"@column_name\"" + "from information_schema.columns)";
ResourceType type = new WhereWrapper(new SqlResourceType(new JdbcSqlQuery(dataSource, new GroovyTemplateGenerator(sql)), asList("column")));
assertEquals(8, type.read(new DbUri("column/main_schema.users")).count());
}
use of com.github.mgramin.sqlboot.model.resource_type.wrappers.list.WhereWrapper in project sql-boot by sql-boot.
the class SqlResourceTypeTest method read.
@Test
public void read() throws Exception {
final String sql = "select * from (select table_schema as \"@table_schema\", table_name as \"@table_name\" " + "from information_schema.tables)";
final ResourceType type = new WhereWrapper(new SqlResourceType(new JdbcSqlQuery(dataSource, new GroovyTemplateGenerator(sql)), asList("table")));
assertEquals(3, type.read(new DbUri("table/m.column")).count());
}
Aggregations