code: func NewSession(ctx context.Context, prm sessionPrm) (*Session, error) {
  
  	if trace {
  		outLogger.Printf("%s", prm)
  	}
  
  	conn, err := newSessionConn(ctx, prm.Host(), prm.Timeout(), prm.TLSConfig())
  	if err != nil {
  		return nil, err
  	}
  
  	rd := bufio.NewReader(conn)
  	wr := bufio.NewWriter(conn)
  
  	s := &Session{
  		prm:                       prm,
  		conn:                      conn,
  		rd:                        rd,
  		wr:                        wr,
  		mh:                        new(messageHeader),
  		sh:                        new(segmentHeader),
  		ph:                        new(partHeader),
  		scramsha256InitialRequest: new(scramsha256InitialRequest),
  		scramsha256InitialReply:   new(scramsha256InitialReply),
  		scramsha256FinalRequest:   new(scramsha256FinalRequest),
  		scramsha256FinalReply:     new(scramsha256FinalReply),
  		topologyInformation:       newTopologyInformation(),
  		connectOptions:            newConnectOptions(),
  		rowsAffected:              new(rowsAffected),
  		statementID:               new(statementID),
  		resultMetadata:            new(resultMetadata),
  		resultsetID:               new(resultsetID),
  		resultset:                 new(resultset),
  		parameterMetadata:         new(parameterMetadata),
  		outputParameters:          new(outputParameters),
  		writeLobRequest:           new(writeLobRequest),
  		readLobRequest:            new(readLobRequest),
  		writeLobReply:             new(writeLobReply),
  		readLobReply:              new(readLobReply),
  		stmtCtx:                   newStatementContext(),
  		txFlags:                   newTransactionFlags(),
  		lastError:                 new(hdbErrors),
  	}
  
  	if err = s.init(); err != nil {
  		return nil, err
  	}
  
  	return s, nil
  }
docs: // NewSession creates a new database session.