@@ -10,13 +10,16 @@ public class IntegresqlClientConfig {
1010 private final String apiVersion ;
1111 public final Boolean debug ;
1212 public final Optional <Integer > portOverride ;
13+ public final Optional <String > hostOverride ;
1314
1415 // Private constructor for builder pattern or factory method
15- private IntegresqlClientConfig (String baseUrl , String apiVersion , Boolean debug , Optional <Integer > portOverride ) {
16+ private IntegresqlClientConfig (String baseUrl , String apiVersion , Boolean debug , Optional <Integer > portOverride ,
17+ Optional <String > hostOverride ) {
1618 this .baseUrl = baseUrl ;
1719 this .apiVersion = apiVersion ;
1820 this .debug = debug != null ? debug : false ;
1921 this .portOverride = portOverride != null ? portOverride : Optional .empty ();
22+ this .hostOverride = hostOverride != null ? hostOverride : Optional .empty ();
2023 }
2124
2225 // --- Getters ---
@@ -43,7 +46,7 @@ public static IntegresqlClientConfig defaultConfigFromEnv() {
4346 String envBaseUrl = EnvUtil .getEnv ("INTEGRESQL_CLIENT_BASE_URL" , "http://integresql:5000/api" );
4447 String envApiVersion = EnvUtil .getEnv ("INTEGRESQL_CLIENT_API_VERSION" , "v1" );
4548 Boolean envDebug = EnvUtil .getEnvAsBool ("INTEGRESQL_CLIENT_DEBUG" , false );
46- return new IntegresqlClientConfig (envBaseUrl , envApiVersion , envDebug , Optional .empty ());
49+ return new IntegresqlClientConfig (envBaseUrl , envApiVersion , envDebug , Optional .empty (), Optional . empty () );
4750 }
4851
4952 /**
@@ -55,7 +58,7 @@ public static IntegresqlClientConfig defaultConfigFromEnv() {
5558 * @return A new IntegresqlClientConfig instance.
5659 */
5760 public static IntegresqlClientConfig customConfig (String baseUrl , String apiVersion , Boolean debug ,
58- Optional <Integer > portOverride ) {
61+ Optional <Integer > portOverride , Optional < String > hostOverride ) {
5962 if (baseUrl == null || baseUrl .trim ().isEmpty ()) {
6063 throw new IllegalArgumentException ("Base URL cannot be null or empty" );
6164 }
@@ -65,6 +68,6 @@ public static IntegresqlClientConfig customConfig(String baseUrl, String apiVers
6568 if (debug == null ) {
6669 debug = false ; // Default to false if not provided
6770 }
68- return new IntegresqlClientConfig (baseUrl , apiVersion , debug , portOverride );
71+ return new IntegresqlClientConfig (baseUrl , apiVersion , debug , portOverride , hostOverride );
6972 }
7073}
0 commit comments