()
| 105 | type PGFields []*PGField |
| 106 | |
| 107 | func (fields PGFields) getPrimaryField() *PGField { |
| 108 | var f *PGField |
| 109 | for _, field := range fields { |
| 110 | if field.IsPrimaryKey || field.Name == "id" { |
| 111 | f = field |
| 112 | return f |
| 113 | } |
| 114 | } |
| 115 | return f |
| 116 | } |
| 117 | |
| 118 | func getPostgresqlTableFields(db *gorm.DB, tableName string) (PGFields, error) { |
| 119 | query := fmt.Sprintf(`SELECT |
no outgoing calls
no test coverage detected