RowIter implements the interface tables.Handler.
(ctx *sql.Context, partition sql.Partition)
| 47 | |
| 48 | // RowIter implements the interface tables.Handler. |
| 49 | func (p PgDatabaseHandler) RowIter(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error) { |
| 50 | // TODO: Should the catalog be passed to RowIter like it is for the information_schema tables RowIter? |
| 51 | doltSession := dsess.DSessFromSess(ctx.Session) |
| 52 | c := sqle.NewDefault(doltSession.Provider()).Analyzer.Catalog |
| 53 | |
| 54 | databases := c.AllDatabases(ctx) |
| 55 | dbs := make([]sql.Database, 0, len(databases)) |
| 56 | for _, db := range databases { |
| 57 | name := db.Name() |
| 58 | if name == "information_schema" || name == "pg_catalog" || name == "performance_schema" { |
| 59 | continue |
| 60 | } |
| 61 | dbs = append(dbs, db) |
| 62 | } |
| 63 | sort.Slice(dbs, func(i, j int) bool { |
| 64 | return dbs[i].Name() < dbs[j].Name() |
| 65 | }) |
| 66 | |
| 67 | return &pgDatabaseRowIter{ |
| 68 | dbs: dbs, |
| 69 | idx: 0, |
| 70 | }, nil |
| 71 | } |
| 72 | |
| 73 | // PkSchema implements the interface tables.Handler. |
| 74 | func (p PgDatabaseHandler) PkSchema() sql.PrimaryKeySchema { |
nothing calls this directly
no test coverage detected