stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
270 stars 20 forks source link

Set max connections for plan cmd #93

Closed bplunkett-stripe closed 5 months ago

bplunkett-stripe commented 5 months ago

Description

Now that we fetch schemas in parallel, we should set a maximum number of connections on the connection pool for planning.

Motivation

Follow best practices

Testing

 go run ./cmd/pg-schema-diff apply  --dsn "host=localhost user=postgres password=postgres database=somedb" --schema-dir ~/stripe/temp/examplesql
################################## Review plan ##################################
1. ALTER TABLE "public"."foobar" DROP CONSTRAINT "some_other_constraint";
        -- Statement Timeout: 3s

✔ Yes
############################# Executing statement 1 #############################
ALTER TABLE "public"."foobar" DROP CONSTRAINT "some_other_constraint";
        -- Statement Timeout: 3s

Finished executing statement. Duration: 6.794458ms
################################### Complete ###################################
Schema applied successfully