rko281 / ReStoreForPharo

Relational database persistence for Pharo objects
MIT License
32 stars 7 forks source link

Where should database initialization code live? #19

Open ctSkennerton opened 2 years ago

ctSkennerton commented 2 years ago

Thank you for making ReStore, it is very simple to use!

I'm looking through the documentation and there is something that confuses me. The below code snippet is used to initialize the database and in my development image I ran that in the playground to get started. But when deploying the application I wouldn't want to do that manual step. How do you manage these connections properties in your projects? Is this something that you would put into a class message or is there another way?

ReStore
    connection: (SSWSQLite3Connection on: (Smalltalk imageDirectory / 'test.db') fullName);
    connect;
    addClasses: {Customer. Address. CustomerOrder. CustomerOrderItem. Product};
    synchronizeAllClasses.