Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:support trim clause #720

Merged
merged 2 commits into from
Jan 4, 2023
Merged

feat:support trim clause #720

merged 2 commits into from
Jan 4, 2023

Conversation

idersec
Copy link
Collaborator

@idersec idersec commented Dec 6, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

You can use trim clause to remove the keywords at the beginning or end of a SQL segment, including and,or,xor,,

User Case Description

type TrimTest interface {
// TestTrim
//
// select * from @@table where
//    {{trim}}
//        {{for _, name :=range list}}
//            name = @name or
//        {{end}}
//    {{end}}
TestTrim(list []string)[]gen.T
}

return
}
res.Value = append(res.Value, trimClause)
s.appendTmpl(trimClause.Finish(res.VarName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is not formatted?

return
}
res.Value = append(res.Value, trimClause)
s.appendTmpl(trimClause.Finish(res.VarName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this line not formatted too.

@idersec idersec merged commit 8b6f628 into master Jan 4, 2023
@jinzhu jinzhu deleted the trim branch January 4, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants