Add primary key column gen
This commit is contained in:
parent
18e76aa081
commit
ef03225024
2 changed files with 3 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Reference in a new issue