(b squirrel.StatementBuilderType)
| 164 | } |
| 165 | |
| 166 | func publicTables(b squirrel.StatementBuilderType) ([]string, error) { |
| 167 | rows, err := b.Select("table_name").From("INFORMATION_SCHEMA.TABLES"). |
| 168 | Where("table_schema = 'public'").Query() |
| 169 | |
| 170 | res := []string{} |
| 171 | if err != nil { |
| 172 | return res, err |
| 173 | } |
| 174 | |
| 175 | for rows.Next() { |
| 176 | var s string |
| 177 | rows.Scan(&s) |
| 178 | res = append(res, s) |
| 179 | } |
| 180 | |
| 181 | return res, nil |
| 182 | } |
| 183 | |
| 184 | // importTable reads a table definition and writes a corresponding struct. |
| 185 | // SELECT table_name, column_name, data_type, character_maximum_length |
no test coverage detected