Search in sources :

Example 1 with SqlQuery

use of com.github.mgramin.sqlboot.sql.SqlQuery in project sql-boot by sql-boot.

the class JdbcSqlQueryTest method medataData.

@Test
public void medataData() throws Exception {
    SqlQuery sqlQuery = new JdbcSqlQuery(dataSource, new GroovyTemplateGenerator("select name /* name */, email /* email */ from main_schema.users"));
    final Map<String, String> metadata = sqlQuery.metaData();
    System.out.println(metadata);
    assertEquals("email", metadata.get("email"));
    assertEquals("name", metadata.get("name"));
}
Also used : SqlQuery(com.github.mgramin.sqlboot.sql.SqlQuery) GroovyTemplateGenerator(com.github.mgramin.sqlboot.template.generator.impl.GroovyTemplateGenerator) Test(org.junit.Test)

Aggregations

SqlQuery (com.github.mgramin.sqlboot.sql.SqlQuery)1 GroovyTemplateGenerator (com.github.mgramin.sqlboot.template.generator.impl.GroovyTemplateGenerator)1 Test (org.junit.Test)1