"How to install SandstoneDb to your Image" by Mike Filonov on at mikefilonov/configurationOfSandstoneDb  0 thanks

How to install SandstoneDb to your Image

I have added a configuration for SandstoneDb to the official repository of the project so now it is very easy to install. Just open a workspace and evaluate:

Gofer new
    url: 'http://smalltalkhub.com/mc/gnaritas/SandstoneDb/main';
    package: 'ConfigurationOfSandstoneDb';

(Smalltalk at: #ConfigurationOfSandstoneDb) load.

By default SandstoneDb is working with Memory store which means the data is not really saved. In order to change store to file system you may exectute following code:

SDFileStore install

This call will change the store and create all required folders in the working directory (usually it is a folder with the image).

Be aware that if you create new subclasses of SDActiveRecord you need to re-initialize file store in order to create all neccecary folder for the new classes. You may do so by evaluating following code:

SDActiveRecord warmUpAllClasses 

More on the subject

  1. http://onsmalltalk.com/sandstonedb-simple-activerecord-style-persistence-in-squeak
  2. http://book.seaside.st/book/advanced/persistency/sandstone
blog comments powered by Disqus