Saving data permanently
Saving the database
When you refresh the web browser or leave SA Studion the database is
by default not saved and thus it disappears. The command save saves
the database permanently so that all data and function definitions
remain the next time you use SA Engine. The result of save is the
name of a file where the database is saved.
Example:
save
The save command will save the current database in a database image
file named sa.edge.dmp inside the bin folder of your SA home
folder. You get the current SA home folder by evaluating:
sa_home()
You can list the files in your SA home bin folder by calling:
dir(sa_home()+"bin")
Inside the web browser the SA home folder is located in
/home/web_user/SA/.
In the free version of SA Studio the saved database will disappear after 1-2 days and SA Studio will then use the original factory database instead.
If you run a downloaded
system under Windows SA home folder is located in
%USERPROFILE%\Documents\SA and the database will thus be saved
persistently in the file
%USERPROFILE%\Documents\SA\bin\sa.engine.dmp. Under OSX the folder
is located in ~/Documents/SA and under Linux in ~/SA.
You can find the exact location and name of the current image file by calling the function:
image_file()
Restoring the factory database
You can erase the current saved database and reset it to the original factory database by calling:
erase_image()
The function returns the name of the erased database file. When the browser is refreshed or SA Studio restarted it will use the original factory database image.
If you change your mind before the refresh you can restore the erased
database by calling save.
