[feat] 新增 表结构操作
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
func PrefixArray(prefix string, values []string) (items []string) {
|
||||
for _, value := range values {
|
||||
items = append(items, prefix+" "+value)
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
func QuoteString(value any) string {
|
||||
switch v := value.(type) {
|
||||
case []string:
|
||||
return strings.Join(lo.Map(v, func(item string, _ int) string {
|
||||
return "'" + item + "'"
|
||||
}), ", ")
|
||||
case string:
|
||||
return "'" + v + "'"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in New Issue
Block a user