code: public void serialize(QueryMetadata metadata, boolean forCountRow, SQLSerializer context) {
          context.serializeForQuery(metadata, forCountRow);
  
          if (!metadata.getFlags().isEmpty()) {
              context.serialize(Position.END, metadata.getFlags());
          }
      }
docs: template method for SELECT serialization
  
  @param metadata
  @param forCountRow
  @param context