简体   繁体   English

从 Mendix 应用程序中删除数据库

[英]Delete the database from Mendix apps

I would like to know how I can delete the local database of my Mendix programm.我想知道如何删除 Mendix 程序的本地数据库。

The background story is that i am calling a webservice to write data to an attribute.背景故事是我正在调用 Web 服务来将数据写入属性。 So every time the user presses a button, the webservice writes data to the attribute.因此,每次用户按下按钮时,webservice 都会将数据写入属性。 That leads to many entries with the same value.这会导致许多条目具有相同的值。 I already fixed the problem with a validation check but I can't get rid of the entries.我已经通过验证检查解决了这个问题,但我无法摆脱这些条目。

Does somebody know how to delete those?有人知道如何删除那些吗?

This depends on wether you run an in memory database (like HSQL) or a local database server like MS SQL Server or Postgres.这取决于您是在 memory 数据库(如 HSQL)还是本地数据库服务器(如 MS SQL 服务器或 Postgres)中运行。

Your HSQL database will be empty on every restart, but with a local database instance it won't.您的 HSQL 数据库在每次重新启动时都会为空,但对于本地数据库实例则不会。 Here you can use the database management tools (PostgreSQL -> PgAdmin, MSSQLSERVER -> Microsoft SQL Server Management Studio) to connect to your database.在这里,您可以使用数据库管理工具(PostgreSQL -> PgAdmin、MSSQLSERVER -> Microsoft SQL Server Management Studio)连接到您的数据库。 Once you've done that you will need to find your table (it will be modulename$entityname) and execute a query, eg TRUNCATE modulename$entityname if you want to delete all records in the table, or DELETE FROM modulename$entityname WHERE (predicate) if you want to delete specific records.完成后,您将需要找到您的表(它将是 modulename$entityname)并执行查询,例如 TRUNCATE modulename$entityname 如果您想删除表中的所有记录,或者 DELETE FROM modulename$entityname WHERE (谓词)如果要删除特定记录。

If you want to get rid of the existing entries, you can always create a microflow that does retrieves all of them from the database and deletes them.如果您想摆脱现有条目,您始终可以创建一个微流程,从数据库中检索所有条目并删除它们。 You can create an admin section with a button to run this microflow (if you only need to do this once) or create a scheduled event that runs the microflow (say every day).你可以创建一个带有按钮的管理部分来运行这个微流(如果你只需要这样做一次)或创建一个运行微流的计划事件(比如每天)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM