The DbCleaner API provides you functionality for freeing up database space. This is accomplished through actions that enable you to:

When you delete Entities and Attributes in your applications, OutSystems Platform doesn't delete the corresponding table or column in the database. Your data is safely stored just in case you want to rollback your application. This API allows you to delete module versions, entities, and attributes that are no longer used, thus freeing database space.

All calls to the DbCleaner API are audited and logged. Audit logs are displayed in the General Log section of the environment management console, and errors are logged under the Error Log section.

To use this API simply reference the DbCleaner_API module using the References Window in the development environment.

Requirements

To use this API, there are the following requirements:

When deleting multi-tenant Entities, or Static Entities with translations, the 9.0.0.23 version of this API requires republishing the modules using the deleted tables or columns. This implies republishing the module that had the Entity or Attribute and all the modules that reference it.

Actions

Action

Description

Attribute_DropColumn(Integer)

Deletes the table column in the database associated to the specified entity attribute. If the entity attribute still exists in a module’s metamodel, the operation will not be performed.

The logged user needs to have the 'Administrator' built-in role.

Attribute_ListDeleted()

Returns a list of the attributes, with their information, that have been deleted from module’s metamodel but are present in the database.

The logged user needs to have the 'Administrator' built-in role.

Entity_DropTable(Integer)

Deletes the table in the database associated to the specified entity. If the entity still exists in an module’s metamodel, the operation will not be performed.

The logged user needs to have the 'Administrator' built-in role.

Entity_ListDeleted()

Returns a list of the entities, with their information, that have been deleted from module’s metamodel but are present in the database.

The logged user needs to have the 'Administrator' built-in role.

ModuleVersion_Delete(Integer, Integer)

Deletes the specified module version of the given module from the database.

The logged user needs to have 'Change & Deploy' permissions.

ModuleVersion_DeleteAll(DateTime, Integer, Integer)

Deletes from the database module versions with a published date older than the specified value.

The logged user needs to have 'Change & Deploy' permissions.

ModuleVersion_ListOldest(DateTime, Text, ModuleType Identifier, Integer)

Returns a list of the module versions and their information with a published date older than the specified value and that are kept stored in the database.

The logged user needs to have 'Change & Deploy' permissions.

Structures

Structure

Description

AttributeInfo

Information about an entity attribute.

EntityInfo

Information about an entity.

ModuleInfo

Information about a module.

ModuleVersionInfo

Information about a module version.

Static Entities

Static Entity

Description

ModuleType

The type of the module. The values are: Espace, and Extension.

See Also

About APIs | How Data Model Changes are Handled