Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typegen): support db-url that require ssl mode #1965

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

sweatybridge
Copy link
Contributor

@sweatybridge sweatybridge commented Feb 20, 2024

What kind of change does this PR introduce?

Bug fix supabase/postgres-meta#719

What is the new behavior?

Updates postgres-meta to 0.77.2 for ssl support.

Additional context

Add any other context or screenshots.

@sweatybridge sweatybridge requested a review from a team as a code owner February 20, 2024 06:36
@coveralls
Copy link

coveralls commented Feb 20, 2024

Pull Request Test Coverage Report for Build 7969693528

Details

  • 0 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 58.798%

Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 11.76%
Totals Coverage Status
Change from base Build 7957896574: -0.004%
Covered Lines: 6192
Relevant Lines: 10531

💛 - Coveralls

@sweatybridge sweatybridge force-pushed the ssl-typegen branch 2 times, most recently from ec216f6 to fd6e9c9 Compare February 20, 2024 06:55
@sweatybridge sweatybridge merged commit 4ce8038 into main Feb 20, 2024
9 checks passed
@sweatybridge sweatybridge deleted the ssl-typegen branch February 20, 2024 07:18
@Mrhoho
Copy link

Mrhoho commented Feb 24, 2024

Will this merge cause this error?

npx supabase gen types typescript --db-url=postgresql://postgres:password@localhost:5431/postgres > src/types/database.d.ts
Connecting to localhost
v0.77.2: Pulling from supabase/postgres-meta
f546e941f15b: Pull complete 
06495e08993c: Pull complete 
8f7f70c95d2f: Pull complete 
250e515ba9d8: Pull complete 
87c2f57477b2: Pull complete 
a9db845078fd: Pull complete 
7fada51dd304: Pull complete 
8b8519bb20b4: Pull complete 
9cd5da2c1bd1: Pull complete 
742946c4d253: Pull complete 
Digest: sha256:e093e4848a83c1339700ed03e671f3d4f8b1f4c32ea5b9f0d574fe0eeb5bda32
Status: Downloaded newer image for public.ecr.aws/supabase/postgres-meta:v0.77.2
(node:1) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///usr/src/app/dist/server/server.js:57
        throw new Error(schemasError.message);
              ^

Error: The server does not support SSL connections
    at file:///usr/src/app/dist/server/server.js:57:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.11.1
error running container: exit 1
Try rerunning the command with --debug to troubleshoot the error.

@sweatybridge
Copy link
Contributor Author

Yes, could you try the beta release?

npx supabase@beta gen types ...

@Mrhoho
Copy link

Mrhoho commented Feb 24, 2024

Yes, could you try the beta release?

npx supabase@beta gen types ...

It seems that the process hangs without any output for a long time

@Mrhoho
Copy link

Mrhoho commented Feb 24, 2024

image

npx supabase@beta gen types typescript --help                  
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

npx supabase@beta gen types typescript --db-url=postgresql://postgres:password@localhost:5431/postgres > src/types/database.d.ts
Access token not provided. Supply an access token by running supabase login or setting the SUPABASE_ACCESS_TOKEN environment variable.

@sweatybridge
Copy link
Contributor Author

I've found the issue and patched it in the beta release. Thanks for reporting it.

$ npx supabase@beta gen types typescript --db-url 'postgresql://postgres:[email protected]:54322/postgres'
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y
Connecting to 127.0.0.1 54322
(node:1) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[]

jhf added a commit to statisticsnorway/statbus that referenced this pull request Feb 27, 2024
Ref. supabase/cli#1965
Use the latest beta release with the workaround that preventes the
error with connection that requires ssl, that we don't need.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sslmode=require ignored on postgresql URL with gen types --db-url
3 participants