// ToQuery produces a dynamodb.QueryInput value based on configured builder
ToQuery produces a dynamodb.QueryInput value based on configured builder
// ToQuery produces a dynamodb . QueryInput value based on configured builder
func (s *Builder) ToQuery() (dynamodb.QueryInput, error) {
	if s.err != nil {
		return dynamodb.QueryInput{}, s.err
	}
	var query dynamodb.QueryInput
	if s.keyExpression != "" {
		query.KeyConditionExpression = aws.String(s.keyExpression)
	}
	if s.filterExpresion != "" {
		query.FilterExpression = aws.String(s.filterExpresion)
	}
	if s.selectedFields != "" {
		query.Select = aws.String("SPECIFIC_ATTRIBUTES")
		query.ProjectionExpression = aws.String(s.selectedFields)
	}
	if len(s.cols) > 0 {
		query.ExpressionAttributeNames = s.cols
	}
	if len(s.vals) > 0 {
		query.ExpressionAttributeValues = s.vals
	}
	if s.limit > 0 {
		query.Limit = aws.Int64(int64(s.limit))
	}
	if s.index != "" {
		query.IndexName = aws.String(s.index)
	}
	if s.table != "" {
		query.TableName = aws.String(s.table)
	}
	if s.ascending != nil {
		query.ScanIndexForward = s.ascending
	}
	if s.consistent != nil {
		query.ConsistentRead = s.consistent
	}
	return query, nil
}
func ( s * Builder ) ToQuery ( ) ( dynamodb . QueryInput , error ) { if s . err != nil { return dynamodb . QueryInput { } , s . err } var query dynamodb . QueryInput if s . keyExpression != " " { query . KeyConditionExpression = aws . String ( s . keyExpression ) } if s . filterExpresion != " " { query . FilterExpression = aws . String ( s . filterExpresion ) } if s . selectedFields != " " { query . Select = aws . String ( " " ) query . ProjectionExpression = aws . String ( s . selectedFields ) } if len ( s . cols ) > 0 { query . ExpressionAttributeNames = s . cols } if len ( s . vals ) > 0 { query . ExpressionAttributeValues = s . vals } if s . limit > 0 { query . Limit = aws . Int64 ( int64 ( s . limit ) ) } if s . index != " " { query . IndexName = aws . String ( s . index ) } if s . table != " " { query . TableName = aws . String ( s . table ) } if s . ascending != nil { query . ScanIndexForward = s . ascending } if s . consistent != nil { query . ConsistentRead = s . consistent } return query , nil }
ToQuery produces a dynamodb.QueryInput value based on configured builder
ToQuery produces a dynamodb . QueryInput value based on configured builder