From da1d1d418f9eca11760bcc47115cac849d4b86b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Wed, 19 Apr 2017 11:39:08 +0200 Subject: [PATCH] SQL EqualString formater --- format_utility.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/format_utility.go b/format_utility.go index 2046db9..99a4126 100644 --- a/format_utility.go +++ b/format_utility.go @@ -30,6 +30,13 @@ func EqualQuotes(stmt string) string { return stmt } +func EqualString(stmt string) string { + if stmt != "" { + stmt = fmt.Sprintf(" = %s", stmt) + } + return stmt +} + // LikeQuotes encapsulates given string in SQL 'like' statement and returns result. // Example: "hello" -> " LIKE UPPER('%hello%')" func LikeQuotes(stmt string) string { -- 1.8.1.2