(c *column, pks []string, tbl string, b squirrel.StatementBuilderType)
| 269 | } |
| 270 | |
| 271 | func structField(c *column, pks []string, tbl string, b squirrel.StatementBuilderType) string { |
| 272 | tpl := "%s %s `stbl:\"%s\"`" |
| 273 | gn := goName(c.Name) |
| 274 | tt := goType(c.DataType) |
| 275 | |
| 276 | tag := c.Name |
| 277 | for _, p := range pks { |
| 278 | if c.Name == p { |
| 279 | tag += ",PRIMARY_KEY" |
| 280 | if sequentialKey(tbl, c.Name, b) { |
| 281 | tag += ",SERIAL" |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | return fmt.Sprintf(tpl, gn, tt, tag) |
| 287 | } |
| 288 | |
| 289 | // goType takes a SQL type and returns a string containin the name of a Go type. |
| 290 | // |
no test coverage detected