(tables schema.Tables)
| 32 | } |
| 33 | |
| 34 | func (c *Client) sqliteTables(tables schema.Tables) (schema.Tables, error) { |
| 35 | var schemaTables schema.Tables |
| 36 | for _, table := range tables { |
| 37 | var columns []schema.Column |
| 38 | info, err := c.getTableInfo(table.Name) |
| 39 | if info == nil { |
| 40 | continue |
| 41 | } |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | for _, col := range info.columns { |
| 46 | columns = append(columns, schema.Column{ |
| 47 | Name: col.name, |
| 48 | Type: c.sqliteTypeToArrowType(col.typ), |
| 49 | PrimaryKey: col.pk != 0, |
| 50 | NotNull: col.notNull, |
| 51 | }) |
| 52 | } |
| 53 | schemaTables = append(schemaTables, &schema.Table{Name: table.Name, Columns: columns}) |
| 54 | } |
| 55 | return schemaTables, nil |
| 56 | } |
| 57 | |
| 58 | func (c *Client) normalizeTables(tables schema.Tables) schema.Tables { |
| 59 | flattened := tables.FlattenTables() |
no test coverage detected