Go - SqlDatabase.ConnectionString()
This is reference documentation for the Nitric Go SDK. To learn about SQL Databases in Nitric start with the SQL docs.
Returns the connection string for a SQL database at runtime.
import ("context""github.com/nitrictech/go-sdk/nitric")func main() {db := nitric.NewSqlDatabase("my-database")// Should be called at runtime, such as in a service handlerconnStr, _ := db.ConnectionString(context.TODO())nitric.Run()}
Examples
Return a connection string
import ("context""github.com/nitrictech/go-sdk/nitric")func main() {db := nitric.NewSqlDatabase("my-database")// Should be called at runtime, such as in a service handlerconnStr, _ := db.ConnectionString(context.TODO())nitric.Run()}
Last updated on Apr 3, 2025