(ctx context.Context, pgDSN string)
| 238 | } |
| 239 | |
| 240 | func openPostgresPool(ctx context.Context, pgDSN string) (*pgxpool.Pool, error) { |
| 241 | pool, err := pgxpool.New(ctx, pgDSN) |
| 242 | if err != nil { |
| 243 | return nil, fmt.Errorf("open postgres pool: %w", err) |
| 244 | } |
| 245 | if err := pool.Ping(ctx); err != nil { |
| 246 | pool.Close() |
| 247 | return nil, fmt.Errorf("ping postgres: %w", err) |
| 248 | } |
| 249 | return pool, nil |
| 250 | } |
| 251 | |
| 252 | func runDryRunReport(ctx context.Context, pool *pgxpool.Pool, tables []string, sqliteCounts map[string]int64) (*SQLiteToPostgresMigrationReport, error) { |
| 253 | return buildDryRunReport(ctx, pool, tables, sqliteCounts) |
no test coverage detected