Skip to content

Commit

Permalink
Merge branch 'master' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
xiam committed Nov 5, 2023
2 parents f7ae6c4 + 5025ae3 commit 5b9a03f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapter/cockroachdb/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ const (
DELETE
FROM {{.Table | compile}}
{{.Where | compile}}
{{if .Limit}}
LIMIT {{.Limit}}
{{end}}
`
adapterUpdateLayout = `
UPDATE
Expand Down
5 changes: 5 additions & 0 deletions adapter/cockroachdb/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,9 @@ func TestTemplateDelete(t *testing.T) {
`DELETE FROM "artist" WHERE (id > 5)`,
b.DeleteFrom("artist").Where("id > 5").String(),
)

assert.Equal(
`DELETE FROM "artist" WHERE (id > 5) LIMIT 10`,
b.DeleteFrom("artist").Where("id > 5").Limit(10).String(),
)
}

0 comments on commit 5b9a03f

Please sign in to comment.