pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Support Windows installation

Open adontz opened this issue 1 year ago • 7 comments

When I try to follow installation instructions I get an error https://www.pgschema.com/installation

>ver
Microsoft Windows [Version 10.0.19045.6332]

>go version
go version go1.25.1 windows/amd64

>go install github.com/pgschema/pgschema@latest
go: downloading github.com/pgschema/pgschema v1.1.0
go: downloading github.com/joho/godotenv v1.5.1
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/jackc/pgx/v5 v5.7.5
go: downloading github.com/BurntSushi/toml v1.5.0
go: downloading github.com/pganalyze/pg_query_go/v6 v6.1.0
go: downloading golang.org/x/sync v0.16.0
go: downloading github.com/lib/pq v1.10.9
go: downloading github.com/inconshreveable/mousetrap v1.1.0
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/jackc/puddle/v2 v2.2.2
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761
go: downloading golang.org/x/crypto v0.37.0
go: downloading golang.org/x/text v0.24.0
go: downloading google.golang.org/protobuf v1.36.5
# github.com/pgschema/pgschema/internal/ir
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\formatter.go:32:37: undefined: pg_query.Deparse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\formatter.go:457:18: undefined: pg_query.Deparse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\inspector.go:728:26: undefined: pg_query.Parse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\normalize.go:876:31: undefined: pg_query.Parse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\normalize.go:883:28: undefined: pg_query.Deparse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\normalize.go:951:31: undefined: pg_query.Parse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\normalize.go:1055:31: undefined: pg_query.Parse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\normalize.go:1169:31: undefined: pg_query.Deparse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\parser.go:172:30: undefined: pg_query.SplitWithParser
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\parser.go:183:26: undefined: pg_query.Parse
..\go\pkg\mod\github.com\pgschema\[email protected]\internal\ir\parser.go:183:26: too many errors```

adontz avatar Sep 19 '25 07:09 adontz

Windows is not supported

tianzhou avatar Sep 19 '25 07:09 tianzhou

We don't plan to support Windows. Readme updated.

tianzhou avatar Sep 24 '25 03:09 tianzhou

@tianzhou Do you accept contributions for this support ? I want to use tool, but I would not switch OS for it. I better do some work instead.

kant2002 avatar Dec 10 '25 17:12 kant2002

It's only me maintaining the project and I need to make sure that I can promptly fix any issues. Right now, I don't have bandwidth to maintain that extra OS (I don't have the windows dev environment and don't want to spend extra time setting up that).

tianzhou avatar Dec 10 '25 18:12 tianzhou

Usually Windows support is not something super special. And unless it broke Linux in some way probably less work on reviewing.

Personally I’m fine if you don’t want put you word on supporting platform. It can be community supported on best effort basis.

kant2002 avatar Dec 10 '25 23:12 kant2002

I am readily to accept community PRs. But I need to make sure I can maintain it afterwards. And I lack the confidence/bandwidth to support windows long term. Also there is opportunity cost to do so.

tianzhou avatar Dec 11 '25 10:12 tianzhou

That's perfect. I cannot ask for more. I assume that any Windows PR would be trivial/small so that should not burden you. otherwise it's really draining. But in my experience it more about fixing rough edges.

Now to funny things.

PS C:\d\github\pgschema> go build
go: downloading github.com/joho/godotenv v1.5.1
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/BurntSushi/toml v1.5.0
go: downloading github.com/jackc/pgx/v5 v5.7.5
go: downloading golang.org/x/sync v0.17.0
go: downloading github.com/fergusstrange/embedded-postgres v1.33.0
go: downloading github.com/lib/pq v1.10.9
go: downloading github.com/inconshreveable/mousetrap v1.1.0
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761
go: downloading golang.org/x/crypto v0.37.0
go: downloading golang.org/x/text v0.24.0
go: downloading github.com/jackc/puddle/v2 v2.2.2
PS C:\d\github\pgschema> .\pgschema.exe
Declarative schema migration for Postgres

Version: 1.5.0@unknown windows/amd64 unknown

Commands:
  dump    Dump PostgreSQL schema
  plan    Generate migration plan
  apply   Apply schema migrations

Use "pgschema [command] --help" for more information about a command.

Usage:
  pgschema [command]

Available Commands:
  apply       Apply migration plan to update a database schema
  dump        Dump database schema for a specific schema
  help        Help about any command
  plan        Generate migration plan for a specific schema

Flags:
      --debug   Enable debug logging
  -h, --help    help for pgschema

Use "pgschema [command] --help" for more information about a command.
PS C:\d\github\pgschema> .\pgschema.exe apply
Error: database name is required (use --db flag or PGDATABASE environment variable)

Does that mean it's fixed and we argue over nothing? 😄

kant2002 avatar Dec 11 '25 13:12 kant2002