Commit da1d1d418f9eca11760bcc47115cac849d4b86b5

Authored by Marko Tikvić
1 parent 9033286899
Exists in master and in 1 other branch v2

SQL EqualString formater

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
format_utility.go
... ... @@ -30,6 +30,13 @@ func EqualQuotes(stmt string) string {
30 30 return stmt
31 31 }
32 32  
  33 +func EqualString(stmt string) string {
  34 + if stmt != "" {
  35 + stmt = fmt.Sprintf(" = %s", stmt)
  36 + }
  37 + return stmt
  38 +}
  39 +
33 40 // LikeQuotes encapsulates given string in SQL 'like' statement and returns result.
34 41 // Example: "hello" -> " LIKE UPPER('%hello%')"
35 42 func LikeQuotes(stmt string) string {
... ...