Prior to learning how to use DataEngine library, it is important to have an idea about the following DataEngine components:
Base Tables: The data imported from external sources such as a C# class, database file, CSV file or JSON file is stored in DataEngine tables called the Base Tables, which act as input data for queries. Every base table has a name and collection of columns. The name should be unique in the workspace. Unlike query results, base tables are not produced by queries.
Connectors: The Data connectors are used to fill base tables with data. The DataEngine has two built-in connectors, one for getting data from databases and the other for getting data from any IEnumerable collection. For importing data from an arbitrary IEnumerable collection to a base table, the DataEngine’s ObjectConnector class is used and for importing data from a database to the base table, the DataEngine’s DbConnector class is used.
Workspace: A workspace is a repository created to store all the base tables, queries and query results of the DataEngine. The DataEngine library represents the workspace by the Workspace class. The Init method of the Workspace class is used to create a new workspace folder or open an existing folder created during an earlier run. The base tables can exist prior to workspace initialization in code. In such a case, the data can be stored in the workspace's folder in memory-mapped files. Some base tables can also be added after workspace initialization. The Workspace class allows us to create queries based on single table or multiple tables using query and join methods. We can retrieve base table data or query result data using GetTableData and GetQueryData methods of the Workspace class. For using base table in constructing queries, the table method of the Workspace class can be used. Further, the TableExists and QueryExists methods of the Workspace class can be used to check whether the specified base table/query exists in the workspace or not.