ClearDatabase clears the internal database, leaving only the default users. This is primarily for use by tests.
()
| 49 | |
| 50 | // ClearDatabase clears the internal database, leaving only the default users. This is primarily for use by tests. |
| 51 | func ClearDatabase() { |
| 52 | clear(globalDatabase.rolesByName) |
| 53 | clear(globalDatabase.rolesByID) |
| 54 | clear(globalDatabase.databasePrivileges.Data) |
| 55 | clear(globalDatabase.schemaPrivileges.Data) |
| 56 | clear(globalDatabase.tablePrivileges.Data) |
| 57 | clear(globalDatabase.sequencePrivileges.Data) |
| 58 | clear(globalDatabase.routinePrivileges.Data) |
| 59 | clear(globalDatabase.roleMembership.Data) |
| 60 | dbInitDefault() |
| 61 | } |
| 62 | |
| 63 | // DropRole removes the given role from the database. If the role does not exist, then this is a no-op. |
| 64 | func DropRole(name string) { |
no test coverage detected