Open creates a new PostgreSQL database instance. If there's a database running at localhost:5432, it will use that. Otherwise, it will start a new postgres container.
(t TBSubset, opts ...OpenOption)
| 173 | // If there's a database running at localhost:5432, it will use that. |
| 174 | // Otherwise, it will start a new postgres container. |
| 175 | func Open(t TBSubset, opts ...OpenOption) (string, error) { |
| 176 | t.Helper() |
| 177 | params, err := DefaultBroker.Create(t, opts...) |
| 178 | if err != nil { |
| 179 | return "", err |
| 180 | } |
| 181 | return params.DSN(), nil |
| 182 | } |
| 183 | |
| 184 | // createDatabaseFromTemplate creates a new database from a template database. |
| 185 | // If templateDBName is empty, it will create a new template database based on |