(tableNames []string)
| 1146 | } |
| 1147 | |
| 1148 | func (d *PostgresDatabase) buildTableDDLComponentsCache(tableNames []string) (*TableDDLComponentsCache, error) { |
| 1149 | cache := &TableDDLComponentsCache{ |
| 1150 | columns: make(map[string][]column), |
| 1151 | primaryKeyCols: make(map[string][]string), |
| 1152 | primaryKeyInfos: make(map[string]primaryKeyInfo), |
| 1153 | indexDefs: make(map[string][]string), |
| 1154 | foreignDefs: make(map[string][]string), |
| 1155 | rlsDefs: make(map[string][]string), |
| 1156 | policyDefs: make(map[string][]string), |
| 1157 | checkConstraints: make(map[string][]CheckConstraint), |
| 1158 | uniqueConstraints: make(map[string]map[string]string), |
| 1159 | exclusionDefs: make(map[string][]string), |
| 1160 | comments: make(map[string][]string), |
| 1161 | privilegeDefs: make(map[string][]string), |
| 1162 | } |
| 1163 | if len(tableNames) == 0 { |
| 1164 | return cache, nil |
| 1165 | } |
| 1166 | |
| 1167 | var err error |
| 1168 | cache.columns, err = d.getColumnsForTables(tableNames) |
| 1169 | if err != nil { |
| 1170 | return nil, err |
| 1171 | } |
| 1172 | cache.primaryKeyCols, err = d.getPrimaryKeyColumnsForTables(tableNames) |
| 1173 | if err != nil { |
| 1174 | return nil, err |
| 1175 | } |
| 1176 | cache.primaryKeyInfos, err = d.getPrimaryKeyInfosForTables(tableNames) |
| 1177 | if err != nil { |
| 1178 | return nil, err |
| 1179 | } |
| 1180 | cache.indexDefs, err = d.getIndexDefsForTables(tableNames) |
| 1181 | if err != nil { |
| 1182 | return nil, err |
| 1183 | } |
| 1184 | cache.foreignDefs, err = d.getForeignDefsForTables(tableNames) |
| 1185 | if err != nil { |
| 1186 | return nil, err |
| 1187 | } |
| 1188 | cache.rlsDefs, err = d.getRowLevelSecurityDefsForTables(tableNames) |
| 1189 | if err != nil { |
| 1190 | return nil, err |
| 1191 | } |
| 1192 | cache.policyDefs, err = d.getPolicyDefsForTables(tableNames) |
| 1193 | if err != nil { |
| 1194 | return nil, err |
| 1195 | } |
| 1196 | cache.checkConstraints, err = d.getCheckConstraintsForTables(tableNames) |
| 1197 | if err != nil { |
| 1198 | return nil, err |
| 1199 | } |
| 1200 | cache.uniqueConstraints, err = d.getUniqueConstraintsForTables(tableNames) |
| 1201 | if err != nil { |
| 1202 | return nil, err |
| 1203 | } |
| 1204 | cache.exclusionDefs, err = d.getExclusionDefsForTables(tableNames) |
| 1205 | if err != nil { |
no test coverage detected