Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
Getting back to this. I wrote a simple test function in go and it had the same issue.
package main
import (
"context"
"fmt"
"os"
"github.com/jackc/pgx/v4"
)
func Main(args map[string]interface{}) map[string]interface{} {
fmt.Println("starting")
conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL"))
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err)
os.Exit(1)
}
defer conn.Close(context.Background())
var greeting string
err = conn.QueryRow(context.Background(), "select 'Hello, world!'").Scan(&greeting)
if err != nil {
fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err)
os.Exit(1)
}
res := make(map[string]interface{})
res["body"] = greeting
fmt.Println(greeting)
return res
}
But it seems that it is really a issue with Digital Ocean. After creating a database on another cloud provider and suplying it as a connection string it started to work flawlessly. So it seems that DO functions can’t interact with DO PostgresQL…
Hi there,
Seems like you are reaching the timeout time set in your profile settings. Have you tried increasing this a little bit?
Also if you print the p variable, do you see the correct details being parsed after the urlparse(db_url)?
Best,
Bobby
It seems you’re attempting to connect to the development database available for purchase through the app platform. However, please note that this database is exclusively accessible within the app platform ecosystem. Therefore, you must utilize a managed database instead.