// Limit sets the LIMIT clause for the statement, replacing any
// existing limit clause.
771866
func (b *DeleteBuilder) Limit(count interface{}) *DeleteBuilder {
	if b.Delete.Limit == nil {
		b.Delete.Limit = &Limit{}
	}
	b.Delete.Limit.Rowcount = makeValExpr(count)
	return b
}
1241160
func (s *ListJobsInput) SetLimit(v string) *ListJobsInput {
	s.Limit = &v
	return s
}
141098
func (s *DB) Limit(limit interface{}) *DB {
	return s.clone().search.Limit(limit).db
}
259096
func (query Query) Limit(limit int) Query {
	query.LimitResult = limit
	return query
}
253614
func LimitExceeded(message string, args ...interface{}) error {
	return WrapWithMessage(&LimitExceededError{
		Message: fmt.Sprintf(message, args...),
	}, message, args...)
}
155715
func (s *GetResourcesInput) SetLimit(v int64) *GetResourcesInput {
	s.Limit = &v
	return s
}
278529
func (rb *route) SetLimit(limit *sqlparser.Limit) {
	rb.Select.SetLimit(limit)
}
621804
func (session *Session) Limit(limit int, start ...int) *Session {
	session.statement.Limit(limit, start...)
	return session
}
1244348
func limit(s string, length int) string {
	if len(s) < length {
		return s
	}

	return s[:length]
}
396242
func (b *UpdateBuilder) Limit(count interface{}) *UpdateBuilder {
	if b.Update.Limit == nil {
		b.Update.Limit = &Limit{}
	}
	b.Update.Limit.Rowcount = makeValExpr(count)
	return b
}
1355352
func (p *queryPlan) limit() {
	if p.stm.IsLimitSet() {
		tracer.Trace(p.tracer, func() []string {
			return []string{"Limit results to " + strconv.Itoa(int(p.stm.Limit()))}
		})
		p.tbl.Limit(p.stm.Limit())
	}
}
776485
func (me *DefaultAdapter) LimitSql(buf *SqlBuilder, limit interface{}) error {
	if limit != nil {
		buf.Write(me.LimitFragment)
		return me.Literal(buf, limit)
	}
	return nil
}
1001883
func (s *ListRegexPatternSetsInput) SetLimit(v int64) *ListRegexPatternSetsInput {
	s.Limit = &v
	return s
}
19463
func limit(aObj, bObj interface{}, max int) (string, string) {
	elidedPrefix := ""
	elidedASuffix := ""
	elidedBSuffix := ""
	a, b := fmt.Sprintf("%#v", aObj), fmt.Sprintf("%#v", bObj)

	if aObj != nil && bObj != nil {
		if aType, bType := fmt.Sprintf("%T", aObj), fmt.Sprintf("%T", bObj); aType != bType {
			a = fmt.Sprintf("%s (%s)", a, aType)
			b = fmt.Sprintf("%s (%s)", b, bType)
		}
	}

	for {
		switch {
		case len(a) > max && len(a) > 4 && len(b) > 4 && a[:4] == b[:4]:
			// a is too long, b has data, and the first several characters are the same
			elidedPrefix = "..."
			a = a[2:]
			b = b[2:]

		case len(b) > max && len(b) > 4 && len(a) > 4 && a[:4] == b[:4]:
			// b is too long, a has data, and the first several characters are the same
			elidedPrefix = "..."
			a = a[2:]
			b = b[2:]

		case len(a) > max:
			a = a[:max]
			elidedASuffix = "..."

		case len(b) > max:
			b = b[:max]
			elidedBSuffix = "..."

		default:
			// both are short enough
			return elidedPrefix + a + elidedASuffix, elidedPrefix + b + elidedBSuffix
		}
	}
}
405493
func LimitLen(b []byte, max ...interface{}) []byte {
	return b[:MinInt(len(b), max...)]
}
1340008
func (_m *DBClient) IntervalsWithLimit(limit int) ([]models.Interval, error) {
	ret := _m.Called(limit)

	var r0 []models.Interval
	if rf, ok := ret.Get(0).(func(int) []models.Interval); ok {
		r0 = rf(limit)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.Interval)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(int) error); ok {
		r1 = rf(limit)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
718760
func (t *dbTables) getLimitSQL(mi *modelInfo, offset int64, limit int64) (limits string) {
	if limit == 0 {
		limit = int64(DefaultRowsLimit)
	}
	if limit < 0 {
		// no limit
		if offset > 0 {
			maxLimit := t.base.MaxLimit()
			if maxLimit == 0 {
				limits = fmt.Sprintf("OFFSET %d", offset)
			} else {
				limits = fmt.Sprintf("LIMIT %d OFFSET %d", maxLimit, offset)
			}
		}
	} else if offset <= 0 {
		limits = fmt.Sprintf("LIMIT %d", limit)
	} else {
		limits = fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset)
	}
	return
}