(out io.Writer, schemaName string, table *storepb.TableMetadata)
| 3316 | } |
| 3317 | |
| 3318 | func writeIndexesSDL(out io.Writer, schemaName string, table *storepb.TableMetadata) error { |
| 3319 | if tableMissingColumnMetadata(table) { |
| 3320 | // Indexes would reference columns absent from the dump. |
| 3321 | return nil |
| 3322 | } |
| 3323 | for _, index := range table.Indexes { |
| 3324 | // Skip indexes that are constraints (primary key, unique constraints) |
| 3325 | // These are already handled in the CREATE TABLE statement |
| 3326 | if index.Primary || index.IsConstraint { |
| 3327 | continue |
| 3328 | } |
| 3329 | |
| 3330 | if err := writeIndexSDL(out, schemaName, table.Name, index, len(table.Partitions) > 0); err != nil { |
| 3331 | return err |
| 3332 | } |
| 3333 | |
| 3334 | if _, err := io.WriteString(out, ";\n\n"); err != nil { |
| 3335 | return err |
| 3336 | } |
| 3337 | } |
| 3338 | return nil |
| 3339 | } |
| 3340 | |
| 3341 | func writeIndexSDL(out io.Writer, schemaName string, tableName string, index *storepb.IndexMetadata, useOnlyClause bool) error { |
| 3342 | return writeIndexInternal(out, schemaName, tableName, index, useOnlyClause, false) |
no test coverage detected