Beispiel #1
0
func (qd *deleter) statement() *exql.Statement {
	stmt := &exql.Statement{
		Type:  exql.Delete,
		Table: exql.TableWithName(qd.table),
	}

	if qd.Where != nil {
		stmt.Where = qd.where
	}

	if qd.limit != 0 {
		stmt.Limit = exql.Limit(qd.limit)
	}

	stmt.SetAmendment(qd.amendFn)

	return stmt
}
Beispiel #2
0
func (qu *updater) statement() *exql.Statement {
	stmt := &exql.Statement{
		Type:         exql.Update,
		Table:        exql.TableWithName(qu.table),
		ColumnValues: qu.columnValues,
	}

	if qu.Where != nil {
		stmt.Where = qu.where
	}

	if qu.limit != 0 {
		stmt.Limit = exql.Limit(qu.limit)
	}

	stmt.SetAmendment(qu.amendFn)

	return stmt
}
Beispiel #3
0
func (qs *selector) Limit(n int) Selector {
	qs.mu.Lock()
	qs.limit = exql.Limit(n)
	qs.mu.Unlock()
	return qs
}