Skip to content
Snippets Groups Projects
Commit db68907bbb42 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

Add database.PrefixColumn(s)

parent 55a45a234677
No related branches found
No related tags found
No related merge requests found
Pipeline #6644 passed
......@@ -157,3 +157,17 @@
}
return q
}
// PrefixColumns ...
func PrefixColumns(table string, columns ...string) []string {
var prefixed = make([]string, len(columns))
for i, name := range columns {
prefixed[i] = PrefixColumn(table, name)
}
return columns
}
// PrefixColumn ...
func PrefixColumn(table string, column string) string {
return table + "." + column
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment