ionic-orm icon indicating copy to clipboard operation
ionic-orm copied to clipboard

Is there any way to clear entire data in specific entity and clearing data from multiple entities

Open akashbiz opened this issue 7 years ago • 0 comments

I am trying to clear data from database table(entity). I tried using repository as well as entityManager for this but was unable to achieve this. Using Repository:

let repository = connection.getRepository(<entityName>);
repository.remove(<entityName>);

Error: Given object does not have a primary column, cannot transform it to database entity.

Using Entity Manager:

let manager = connection.createEntityManager();
manager.remove(<entityName>);

Error: RepositoryNotFoundError: No repository for "Function" was found. Looks like this entity is not registered in current "dbConnectionName" connection?

Any help?

akashbiz avatar Jan 04 '19 12:01 akashbiz