(databaseName, owner string)
| 389 | } |
| 390 | |
| 391 | func (c *Cluster) databaseNameOwnerValid(databaseName, owner string) bool { |
| 392 | if _, ok := c.pgUsers[owner]; !ok { |
| 393 | c.logger.Infof("skipping creation of the %q database, user %q does not exist", databaseName, owner) |
| 394 | return false |
| 395 | } |
| 396 | |
| 397 | if !databaseNameRegexp.MatchString(databaseName) { |
| 398 | c.logger.Infof("database %q has invalid name", databaseName) |
| 399 | return false |
| 400 | } |
| 401 | return true |
| 402 | } |
| 403 | |
| 404 | // getSchemas returns the list of current database schemas |
| 405 | // The caller is responsible for opening and closing the database connection |
no outgoing calls
no test coverage detected