Best place to Create/Updatedatabase

In the past I have created XData servers the "legacy" way, but now wish to use the new TXDataServer components.

Currently I have an existing database & it all works as expected.

If I want to create a new database (if there is no existing database), when using these new components where do you recommend adding the code to update the database.

Should it be in one of the event handlers (eg TXDataServer.OnModuleCreate, or TXDataServer.OnGetPoolInterface) ?

If so, is there an easy way to obtain a TDatabaseManager object so that I can call UpdateDatabase ?

You should put it in any place of your application that is executed after TAureliusConnection is created and before the database is "used" (by an object manager, for example). It looks like TDataModule.OnCreate event is a good candidate. You can continue using it the old way: