Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Conversation

@nstankov-bg
Copy link

@nstankov-bg nstankov-bg commented Oct 4, 2023

Summary

This PR enhances the flexibility of setting the listening host in cmd/sql-proxy-client/main.go. It allows the host to be configured via an environment variable, PLANETSCALE_LISTENING_HOST, while maintaining "127.0.0.1" as the default value if the variable is not set.

Changes

Modified the host flag to dynamically fetch its value from the PLANETSCALE_LISTENING_HOST environment variable, defaulting to "127.0.0.1" if the variable is not set.

Why

This change provides users with the ability to easily configure the listening host via an environment variable without losing the convenience of a default value.

How to Test

  1. Do not set the environment variable PLANETSCALE_LISTENING_HOST and run the SQL proxy client. Verify that it listens on the default "127.0.0.1" host.
  2. Set the environment variable PLANETSCALE_LISTENING_HOST to a desired host.
  3. Run the SQL proxy client.
  4. Verify that the client is listening on the host specified in the PLANETSCALE_LISTENING_HOST environment variable.

Maintainer:

@skottler, please have a look when you can.

@nstankov-bg nstankov-bg changed the title Update main.go Enhance listening host configuration in cmd/sql-proxy-client via PLANETSCALE_LISTENING_HOST environment variable Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant