refactor: migrate from deprecated database manager

Changes:
- Swaps out `SingleConnectionDatabaseManager` to `DatabaseManager`
  across the repo.
- Updates `backend-test-utils` to generate test plugin names prefixed
  with db to satisfy plugin naming constraint, e.g. 0 becomes db0.

Signed-off-by: Minn Soe <contributions@minn.io>
This commit is contained in:
Minn Soe
2021-05-25 18:28:05 +01:00
parent 2976f3bae3
commit 5a3ce34072
12 changed files with 168 additions and 120 deletions
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SingleConnectionDatabaseManager } from '@backstage/backend-common';
import { DatabaseManager } from '@backstage/backend-common';
import { stringifyEntityRef } from '@backstage/catalog-model';
import { ConfigReader } from '@backstage/config';
import {
@@ -22,7 +22,7 @@ import {
} from './CodeCoverageDatabase';
import { JsonCodeCoverage } from './types';
const db = SingleConnectionDatabaseManager.fromConfig(
const db = DatabaseManager.fromConfig(
new ConfigReader({
backend: {
database: {
@@ -20,14 +20,14 @@ import {
getVoidLogger,
PluginDatabaseManager,
PluginEndpointDiscovery,
SingleConnectionDatabaseManager,
DatabaseManager,
UrlReaders,
} from '@backstage/backend-common';
import { ConfigReader } from '@backstage/config';
import { createRouter } from './router';
function createDatabase(): PluginDatabaseManager {
return SingleConnectionDatabaseManager.fromConfig(
return DatabaseManager.fromConfig(
new ConfigReader({
backend: {
database: {