Package io.trino.tempto.query
Class QueryResult
java.lang.Object
io.trino.tempto.query.QueryResult
- All Implemented Interfaces:
org.assertj.core.api.AssertProvider<QueryAssert>
Result of a query.
It stores all returned values, column names and their types as JDBCType.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder(ResultSetMetaData metaData) <T> List<T>column(int sqlColumnIndex) static QueryResultempty()static QueryResultstatic QueryResultforSingleIntegerValue(int value) static <T> QueryResultforSingleValue(JDBCType type, T value) static intfromSqlIndex(int index) In SQL/JDBC column indexing starts form 1.intgetColumnType(int columnIndex) intproject(int... sqlColumnIndexes) List<?>row(int rowIndex) rows()static inttoSqlIndex(int index) In SQL/JDBC column indexing starts form 1.toString()tryFindColumnIndex(String columnName)
-
Method Details
-
getRowsCount
public int getRowsCount() -
getColumnsCount
public int getColumnsCount() -
getColumnTypes
-
getColumnType
-
tryFindColumnIndex
-
row
-
rows
-
getOnlyValue
-
column
-
project
-
getJdbcResultSet
-
toString
-
assertThat
- Specified by:
assertThatin interfaceorg.assertj.core.api.AssertProvider<QueryAssert>
-
toSqlIndex
public static int toSqlIndex(int index) In SQL/JDBC column indexing starts form 1. This method returns SQL index for given Java index.- Parameters:
index- 0 based column index- Returns:
- index + 1
-
fromSqlIndex
public static int fromSqlIndex(int index) In SQL/JDBC column indexing starts form 1. This method returns Java index for given SQL index.- Parameters:
index- 1 based column index- Returns:
- index - 1;
-
builder
public static QueryResult.QueryResultBuilder builder(ResultSetMetaData metaData) throws SQLException - Throws:
SQLException
-
forSingleIntegerValue
-
forSingleValue
-
empty
-
forResultSet
- Throws:
SQLException
-