Skip to content

Commit

Permalink
feat(database): add Limit for Export
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Jan 18, 2022
1 parent 360d928 commit 6dfbef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/database/offline/sqlutil/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func DoExport(ctx context.Context, dbOpt dbutil.DBOpt, opt DoExportOpt) (*types.
if err != nil {
return nil, err
}
if opt.Limit != nil {
query = fmt.Sprintf("%s LIMIT %d", query, *opt.Limit)
}
args := make([]interface{}, 0, len(opt.CdcTables)*2)
for i := 0; i < len(opt.CdcTables)*2; i++ {
args = append(args, opt.UnixMilli)
Expand Down
1 change: 0 additions & 1 deletion internal/database/offline/sqlutil/export_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ LEFT JOIN
) AS {{ qt $t0 }}
ON e.{{ qt $.EntityName }} = {{ qt $t0 }}.{{ qt $.EntityName }}
{{end}}
`

type unionEntityQueryParams struct {
Expand Down

0 comments on commit 6dfbef0

Please sign in to comment.