(ctx context.Context, db *sql.DB, tables []string)
| 506 | } |
| 507 | |
| 508 | func countSQLiteRows(ctx context.Context, db *sql.DB, tables []string) (map[string]int64, error) { |
| 509 | counts := make(map[string]int64, len(tables)) |
| 510 | for _, table := range tables { |
| 511 | var count int64 |
| 512 | if err := db.QueryRowContext(ctx, "SELECT COUNT(*) FROM "+quoteIdent(table)).Scan(&count); err != nil { |
| 513 | return nil, fmt.Errorf("count sqlite rows for %s: %w", table, err) |
| 514 | } |
| 515 | counts[table] = count |
| 516 | } |
| 517 | return counts, nil |
| 518 | } |
| 519 | |
| 520 | func listPostgresTables(ctx context.Context, pool *pgxpool.Pool) (map[string]struct{}, error) { |
| 521 | rows, err := pool.Query(ctx, ` |
no test coverage detected