public static void columnsFor(ResultSet resultSet,Consumer<Column> consumer) throws SQLException {
  ResultSetMetaData metadata=resultSet.getMetaData();
  ColumnEditor column=Column.editor();
  for (int position=1; position <= metadata.getColumnCount(); ++position) {
    String columnLabel=metadata.getColumnLabel(position);
    column.name(columnLabel != null ? columnLabel : metadata.getColumnName(position));
    column.type(metadata.getColumnTypeName(position));
    column.jdbcType(metadata.getColumnType(position));
    column.length(metadata.getPrecision(position));
    column.scale(metadata.getScale(position));
    column.optional(isNullable(metadata.isNullable(position)));
    column.autoIncremented(metadata.isAutoIncrement(position));
    column.generated(false);
    consumer.accept(column.create());
  }
}

public static void columnsFor ( ResultSet resultSet , Consumer < Column > consumer ) throws SQLException { ResultSetMetaData metadata = resultSet . getMetaData ( ) ; ColumnEditor column = Column . editor ( ) ; for ( int position = 1 ; position <= metadata . getColumnCount ( ) ; ++ position ) { String columnLabel = metadata . getColumnLabel ( position ) ; column . name ( columnLabel != null ? columnLabel : metadata . getColumnName ( position ) ) ; column . type ( metadata . getColumnTypeName ( position ) ) ; column . jdbcType ( metadata . getColumnType ( position ) ) ; column . length ( metadata . getPrecision ( position ) ) ; column . scale ( metadata . getScale ( position ) ) ; column . optional ( isNullable ( metadata . isNullable ( position ) ) ) ; column . autoIncremented ( metadata . isAutoIncrement ( position ) ) ; column . generated ( false ) ; consumer . accept ( column . create ( ) ) ; } }
determine the column definitions for the supplied result set and add each column to the specified consumer .
