@@ -34,6 +34,20 @@ func main() {
34
34
crsMapFilePath := flag .String ("crs" , envString ("PATH_CRS" , "" ), "crs file path" )
35
35
configFilePath := flag .String ("config" , envString ("PATH_CONFIG" , "" ), "configfile path" )
36
36
connectionStr := flag .String ("connection" , envString ("CONNECTION" , "host=127.0.0.1 port=5432 database=bgt_v1 user=postgres password=postgres sslmode=disable" ), "connection string postgis" )
37
+ // alternative database configuration
38
+ if connectionStr == nil && * providerName == "postgis" {
39
+ withDBHost := flag .String ("db-host" , envString ("DB_HOST" , "bgt-cloud-db.postgres.database.azure.com" ), "database host" )
40
+ withDBPort := flag .Int ("db-port" , envInt ("DB_PORT" , 5432 ), "database port number" )
41
+ WithDBName := flag .String ("db-name" , envString ("DB_NAME" , "pdok" ), "database name" )
42
+ withDBSSL := flag .String ("db-ssl-mode" , envString ("DB_SSL_MODE" , "disable" ), "ssl-mode" )
43
+ withDBUser := flag .String ("db-user-name" , envString ("DB_USERNAME" , "postgres" ), "database username" )
44
+ withDBPassword := flag .String ("db-password" , envString ("DB_PASSWORD" , "" ), "database password" )
45
+
46
+ connectionStrAlt := fmt .Sprintf ("host=%s port=%d database=%s sslmode=%s user=%s password=%s" ,
47
+ * withDBHost , * withDBPort , * WithDBName , * withDBSSL , * withDBUser , * withDBPassword )
48
+
49
+ connectionStr = & connectionStrAlt
50
+ }
37
51
38
52
featureIdKey := flag .String ("featureId" , envString ("FEATURE_ID" , "" ), "Default feature identification or else first column definition (fid)" )
39
53
0 commit comments