MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / getColumns

Function getColumns

pkg/sql2code/parser/tableInfo.go:88–104  ·  view source on GitHub ↗
(dbDriver string, fields []tmplField)

Source from the content-addressed store, hash-verified

86}
87
88func getColumns(dbDriver string, fields []tmplField) []Field {
89 var columns []Field
90
91 for _, field := range fields {
92 columns = append(columns, Field{
93 ColumnName: field.ColName,
94 ColumnNameCamel: field.Name,
95 ColumnNameCamelFCL: customFirstLetterToLower(field.Name),
96 ColumnComment: field.Comment,
97 IsPrimaryKey: field.IsPrimaryKey,
98 GoType: field.GoType,
99 Tag: handleTag(dbDriver, field.Tag),
100 })
101 }
102
103 return columns
104}
105
106func handleTag(dbDriver string, tag string) string {
107 if dbDriver == DBDriverMongodb {

Callers 1

newTableInfoFunction · 0.85

Calls 2

customFirstLetterToLowerFunction · 0.85
handleTagFunction · 0.85

Tested by

no test coverage detected