MemDataSource
Overview
Servoy allows the creation of In-Memory tables using HSQL, which behave like regular database tables with similar configurations, including column properties and events. These tables can be populated using a JSDataSet and the createDataSource()
function to dynamically define datasources or foundsets at runtime.
If the In-Memory table was predefined in Servoy Developer, there is no need to re-define column and type information during runtime.
Creating In-Memory Databases
There are two ways to create an In-Memory database:
Via the Solution Explorer, under Datasources -> In Memory -> Create new data source. This opens a dialog to specify the datasource name and the Table Editor for table structure definition.
At runtime, using the JSDataSet::createDataSource function to dynamically define datasources.
Additional Table Event: onLoad
In-Memory tables have an extra event called onLoad, triggered when a form accesses the In-Memory datasource or when datasource.mem.name.getFoundSet()
is called. This event allows on-demand population of the datasource, but you must still use createDataSource()
in the onLoad method to populate the table.
Commands Summary
Create in memory datasource - Opens the Table Editor.
Edit table/view - Edits table structure via the Table Editor.
Delete In Memory Datasource - Deletes the datasource definition.
Rename In Memory Datasource - Renames the datasource definition.
Search for references - Finds locations within the solution where the datasource is used.
For more details, please refer to the In-memory Databases section of the Data modeling documentation.
Last updated