How to Generate Entity (Object) ID within PostgreSQL

3
Hi there! I would like to know if someone can point me to how the Mendix generates an object ID, preferably within the database space. I have a rather complex structure that needs to be tested at scale. Inputting test data from the front-end is taking ages and batch processing is also not quite up for it. I manage to create a SQL script that generates the entities within a reasonable time, the only issue is that after the generation using the SQL script the database is useless as I hit an error when I want to add an object of the same type as generated by the script. (My script just takes the last id of the object and increments it for the next object – not the correct way, but it worked well enough for the initial testing) Thanks in advance!  
asked
3 answers
0

Hi, you can try using scripts by using the Client API: https://docs.mendix.com/apidocs-mxsdk/apidocs/client-api

You can use the mx.data.create to create an MxObject

answered
0

Hi Jord,

Thanks for your response.

I had a quick look at the resource you provided. If I have it right, this means that my application has to be running when I want to use this approach? However, what I found what that the trial license expires prior to my creation being completed.

Are there significant time reductions using the API approach?

answered
0

Hi Nico,

I am intrigued by your question. Could you elaborate a bit more on your specific needs?

Could this not be solved by creating a database once and then backup/restore? Or maybe something similar to database replication could be a solution? https://docs.mendix.com/appstore/modules/database-replication I have always been very impressed with the performance of the replication module.

 

answered