File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 55 "embed"
66 "errors"
77 "fmt"
8+ "net/url"
89 "os"
910 "strings"
1011 "time"
@@ -121,7 +122,9 @@ func NewSystemDatabase() (SystemDatabase, error) {
121122 // TODO: pass proper config
122123 databaseURL := os .Getenv ("DBOS_DATABASE_URL" )
123124 if databaseURL == "" {
124- return nil , NewInitializationError ("DBOS_DATABASE_URL environment variable is required" )
125+ fmt .Println ("DBOS_DATABASE_URL not set, using default: postgres://postgres:${PGPASSWORD}@localhost:5432/postgres?sslmode=disable" )
126+ password := url .QueryEscape (os .Getenv ("PGPASSWORD" ))
127+ databaseURL = fmt .Sprintf ("postgres://postgres:%s@localhost:5432/postgres?sslmode=disable" , password )
125128 }
126129
127130 // Create the database if it doesn't exist
You can’t perform that action at this time.
0 commit comments