Skip to content

Commit

Permalink
QRep UI Improvements (#645)
Browse files Browse the repository at this point in the history
- Searchable dropdowns for table, watermark column, schema selection
- Source peers in create mirror are only postgres peers
- Fixes mirror status screen

Partially implements #646
  • Loading branch information
Amogh-Bharadwaj authored Nov 11, 2023
1 parent cc11a2b commit 173571e
Show file tree
Hide file tree
Showing 24 changed files with 1,443 additions and 729 deletions.
31 changes: 31 additions & 0 deletions flow/cmd/peer_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,37 @@ func (h *FlowRequestHandler) GetTablesInSchema(
return &protos.SchemaTablesResponse{Tables: tables}, nil
}

// Returns list of tables across schema in schema.table format
func (h *FlowRequestHandler) GetAllTables(
ctx context.Context,
req *protos.PostgresPeerActivityInfoRequest,
) (*protos.AllTablesResponse, error) {
peerPool, _, err := h.getPoolForPGPeer(ctx, req.PeerName)
if err != nil {
return &protos.AllTablesResponse{Tables: nil}, err
}

defer peerPool.Close()
rows, err := peerPool.Query(ctx, "SELECT table_schema || '.' || table_name AS schema_table "+
"FROM information_schema.tables;")
if err != nil {
return &protos.AllTablesResponse{Tables: nil}, err
}

defer rows.Close()
var tables []string
for rows.Next() {
var table string
err := rows.Scan(&table)
if err != nil {
return &protos.AllTablesResponse{Tables: nil}, err
}

tables = append(tables, table)
}
return &protos.AllTablesResponse{Tables: tables}, nil
}

func (h *FlowRequestHandler) GetColumns(
ctx context.Context,
req *protos.TableColumnsRequest,
Expand Down
Loading

0 comments on commit 173571e

Please sign in to comment.