Add primary key column gen

This commit is contained in:
Aaron L 2016-08-13 16:10:29 -07:00
parent 18e76aa081
commit ef03225024
2 changed files with 3 additions and 1 deletions

View file

@ -154,7 +154,8 @@ var templateFunctions = template.FuncMap{
"makeStringMap": strmangle.MakeStringMap,
// Set operations
"setInclude": strmangle.SetInclude,
"setInclude": strmangle.SetInclude,
"setIntersect": strmangle.SetIntersect,
// Database related mangling
"whereClause": strmangle.WhereClause,

View file

@ -9,6 +9,7 @@ var (
{{$varNameSingular}}UniqueColumns = []string{{"{"}}{{.Table.Columns | filterColumnsByUnique | columnNames | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
{{$varNameSingular}}PrimaryKeyColumns = []string{{"{"}}{{.Table.PKey.Columns | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
{{$varNameSingular}}AutoIncrementColumns = []string{{"{"}}{{.Table.Columns | filterColumnsByAutoIncrement true | columnNames | stringMap .StringFuncs.quoteWrap | join "," }}{{"}"}}
{{$varNameSingular}}AutoIncPrimaryKeys = []string{{"{"}}{{.Table.Columns | filterColumnsByDefault true | columnNames | setIntersect .Table.PKey.Columns | stringMap .StringFuncs.quoteWrap | join ","}}{{"}"}}
)
type (