0

Anyone configured it successfully?

For now, I'm just listing all entities manually (not as fun).

I tried replicating the example given with Mongoose here.

I tried passing a Connection (it's deprecated though) and a DataSource (should work the same way).

AdminModule.createAdminAsync({
      useFactory: () => ({
        adminJsOptions: {
          rootPath: '/admin',
          databases: [DataSource],
        },
        [...]
      }
}

I get the following error: NoDatabaseAdapterError: There are no adapters supporting one of the database you provided. I can interpret this as if the TypeOrm adapter has no support for providing the whole database, but I'm sceptic that's the case.

1 Answers1

0

Ah, noob mistake. I wasn't injecting the DataSource instance.

AdminModule.createAdminAsync({
  useFactory: (dataSource: DataSource) => ({
    adminJsOptions: {
      rootPath: '/admin',
      databases: [dataSource],
    },
    [...]
  }),
  inject: [DataSource],
}),