Dataset DBs (Reference) define database connections for data storage, retrieval, and manipulation within the FrameworX platform. It provides:
Each DB represents a connection to a database used for tags, alarms, historian, or custom data operations.
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude Steps style none
Property | Description | Required |
---|---|---|
Name | Unique database identifier | Yes |
Provider | Database technology (SQLite, SqlClient, etc.) | Yes |
Database | Database type/instance | Yes |
ConnectionString | Connection parameters | Yes |
LogonPassword | Authentication password (admin only) | No |
ServerIP | Remote gateway for security | No |
FilterColumns | Query optimization columns | No |
CustomOptions | Additional configuration | No |
Description | Documentation text | No |
Four system databases are included in every solution:
DB Name | Purpose | Default Location |
---|---|---|
Retentive | Stores retentive tag values | <SolutionNameAndPath>.dbRetentive |
RuntimeUsers | Dynamic user management | <SolutionNameAndPath>.dbRuntimeUsers |
AlarmHistorian | Alarm and audit trail records | <SolutionNameAndPath>.dbAlarmHistorian |
TagHistorian | Time-series data storage | <SolutionNameAndPath>.dbTagHistorian |
Provider=<provider>;Data Source=<source>;Additional Parameters
SQLite (Local):
Provider=System.Data.SQLite;
Data Source=_SolutionPathAndName_.db
SQL Server Express:
DataSource=.\SQLEXPRESS;
Initial Catalog=myDatabase;
User Id=sa;Password=pwd
PostgreSQL:
Host=localhost;Database=mydb;
Username=user;Password=pass;Port=5432
Use these macros for portable configurations:
Macro | Description | Example |
---|---|---|
_SolutionPath_ | Solution directory | C:\Solutions\MyApp\ |
_SolutionName_ | Solution name only | MyApp |
_SolutionPathAndName_ | Full path with name | C:\Solutions\MyApp\MyApp |
_ExecutionPath_ | Working directory | Current runtime folder |
_ExecutionPathAndName_ | Working path with name | Runtime location |
_ProductPath_ | Installation directory | C:\Program Files\FrameworX\ |
_Transfers_ | Default transfer folder | Public\Documents\Transfers\ |
_ThirdParty_ | Third-party components | MyDocuments\ProductName\ThirdParty\ |
Provider | Supported Databases |
---|---|
System.Data.SQLite | SQLite |
System.Data.SqlClient | SQL Server, SQL Server Express |
Npgsql | PostgreSQL |
MySql.Data.MySqlClient | MySQL |
Oracle.DataAccess.Client | Oracle |
System.Data.Odbc | Any ODBC-compatible |
System.Data.OleDb | Access, Excel, CSV |
Database | Syntax Example | Special Considerations |
---|---|---|
SQL Server | SELECT TOP 10 * FROM Table | Use TOP for limiting |
SQLite | SELECT * FROM Table LIMIT 10 | Use LIMIT clause |
MySQL | SELECT * FROM \ Table` LIMIT 10` | Backticks for names |
PostgreSQL | SELECT * FROM "Table" LIMIT 10 | Case-sensitive names |
Oracle | SELECT * FROM Table WHERE ROWNUM <= 10 | ROWNUM for limiting |
For concurrent operations to same database:
DB1 → Production Database (Thread 1)
DB2 → Production Database (Thread 2)
DB3 → Production Database (Thread 3)
Create multiple DB connections to same database for parallelism.
Default Behavior:
Configuring External Databases:
DateTimeMode Settings:
- UTC: No conversion needed
- LocalTime: Platform converts automatically
- Custom: Handle in SQL statements
Local Time Queries:
sql
-- Adjust for local time zone (example: EST -5 hours)
WHERE Timestamp >= DATEADD(hour, -5, @Tag.StartTimeUTC)
Automatic database switching for development:
Production DB | Development Override |
---|---|
<name>.dbRetentive | <name>.dbRetentiveDev |
<name>.dbRuntimeUsers | <name>.dbRuntimeUsersDev |
<name>.dbAlarmHistorian | <name>.dbAlarmHistorianDev |
<name>.dbTagHistorian | <name>.dbTagHistorianDev |
Configure ServerIP for gateway security:
Gateway Configuration for Restricted Databases:
Benefits:
Built-in tool for SQLite management:
Interactive SQL query creation:
The Store & Forward feature has specific requirements:
For Store & Forward configuration, see Historian Archiving Process documentation.
Connection failed:
Access denied:
Performance issues:
Page Tree | ||
---|---|---|
|
The DatasetDB in the Dataset Module is the object that allows the connection of the solution with external SQL databases.
On this page:
Table of Contents | ||||
---|---|---|---|---|
|
Tip | ||
---|---|---|
| ||
There are two utilities you can access through buttons in this page.
To create a new DB connection, follow the steps below:
Access Datasets / DBs.
Click the plus icon.
Fill in the Name field and select a Provider and a Database. In addition, provide a meaningful description to make it easier to execute maintenance in the future.
Press Ok.
When using SQLite databases, the Dataset Module can automatically create the database locally if it doesn't already exist. For other database types, the database itself must already exist before you set your connection.
To configure a DB, follow the steps below.
Access Datasets/ DBs.
Double-click the property you wish to edit on the row corresponding to the channel you want to modify.
Edit the property field.
Warning |
---|
In general, the ConnectionString has one more field "Additional Parameters", where typically you add the content "User Id"= <username>. But, Each database has its own settings for security, so refer to specific database documentation for its expected syntax on connection strings. |
ConnectionString example for Microsoft SQL Express:
Info |
---|
Any user can create new connections in the solution. However, only the Administrator can configure database login passwords. |
When defining the ConnectionString, the following macros are available, independently of the select provider:
ConnectionString Macro
Macro
Description
_ExecutionPath_
Working directory for the solution. Unless otherwise configured, or modified, it is the folder where the solution file is located.
_ExecutionPathAndName_
Working directory for the solution, and solution name.
_ProductPath_
Path where the product is installed.
_SolutionName_
Name of the solution, without path and without extension. Example: Solution1
_SolutionPath_
Path of the solution file.
_SolutionPathAndName_
Path of the solution and its name (without extension)
_Transfers_
Path of the default folder to transfers, usually the folder Transfers under the product folders in Public Documents.
_ThirdParty_
Path for the ThirdParty folder, usually located under MyDocuments/<productName>/ThirdParty
_WpfControls_
Path for the WpfControls folder, located in the product Installation folder, sub-directly WpfControls
There are four database connections preloaded into any new solution.
Datasets DB - Pre-defined database connections
DB
Database
Path Location
Usage
Retentive
SQLite
<ProjectNameAndPath>.dbRetentive
Stores values for Retentive Tags.
RuntimeUsers
SQLite
<ProjectNameAndPath>.dbRuntimeUsers
Stores dynamically created Users.
AlarmHistorian
SQLite
<ProjectNameAndPath>.dbAlarmHistorian
Stores Alarm and AuditTrail records.
TagHistorian
SQLite
<ProjectNameAndPath>.dbTagHistorian
Stores Tag Historian and Annotations.
If you need to use another database for the pre-defined connections, follow these steps below:
Rename or delete the previous DB. This step is necessary, as the system would not allow the creation of two objects with the same name.
The following table describes each available property you can configure when editing a DB:
Info |
---|
If a column is not visible on the grid, enable it by right-clicking the grid header and selecting it from the list. |
Property
Description
ID
Identifies each database entry uniquely to distinguish between different database configurations.
VersionID
Specifies the version of the database configuration to track changes and manage different versions effectively.
Name
Provides a name for the database configuration to easily reference and identify it within the system.
Provider
Defines the provider technology used in the connection, such as System.Data.SQLite, which determines the specific database type and driver.
Database
Identifies the type of dataset used in this connection to ensure compatibility and proper data handling.
ConnectionString
Establishes the connection to the database by entering the server path and instance. The selected database provider defines the syntax. Uses third-party components and macros for flexibility. Utilizes the interface to define fields like Provider, Data Source, and Additional Parameters. For example, Provider=System.Data.SQLite;Data Source=_ExecutionPathAndName_.dbAlarm.
CustomOptions
Provides additional configuration options for the database connection or operations to customize behavior and performance.
LogonPassword
Provides the corresponding password for the database login. This property is only accessible by administrators to ensure security.
FilterColumns
Lists columns used to filter data during database operations to optimize queries and improve data retrieval efficiency.
ServerIP
Specifies an optional IP address or DNS name for a computer to be used as a secure gateway, in case the database is not running in the local computer, enhancing security and access control.
The TWebServices must be installed on the remote computer.
Level
Assigns the security or access level for the database entry to manage permissions and protect sensitive data.
Category
Categorizes the database entry for organizational purposes to facilitate management and reporting.
LockState
Indicates the current lock status of the database entry to manage concurrent access and ensure data integrity.
LockOwner
Identifies the user or process holding the lock on the database entry to track changes and maintain accountability.
DateModified
Records the date and time when the database entry was last modified to maintain a history of changes and updates.
DateCreated
Records the date and time when the database entry was created to track the creation and initial configuration.
Description
Provides a brief description of the database connection to give context and additional information for reference.
Below you can access guides that present step-by-step instructions on how to connect to specific databases.
Connecting to SQL ServerAssume you must transition the Alarm Historian configuration to a Microsoft SQL production database within your organization. During the development and testing phases of the application, you may prefer to wait to publish alarm events to that database. In other platforms, it would be necessary to manually switch connections between test and production environments or devise workarounds to handle this situation. We provide a built-in, optional feature. You can configure the Alarm Historian DB to target the production database, regardless of its current availability or intended use. Subsequently, run the solution in Test Mode, storing data in the local SQLite file <projectName>.dbAlarmHistorianTest
.
When running the solution in validation mode, there is a configuration set by default that can override the connection of the pre-defined DB, using testing ones instead.
That configuration is defined in Runtime Execution Profiles.
The following table lists the database files that can be enabled to use when running in Development Mode:
DB | Database | Path Location | Usage |
---|---|---|---|
Retentive | SQLite | <ProjectNameAndPath>.dbRetentiveDev | Stores values for Retentive Tags. |
RuntimeUsers | SQLite | <ProjectNameAndPath>.dbRuntimeUsersDev | Stores dynamically created Users. |
AlarmHistorian | SQLite | <ProjectNameAndPath>.dbAlarmHistorianDev | Stores Alarm and AuditTrail records. |
TagHistorian | SQLite | <ProjectNameAndPath>.dbTagHistorianDev | Stores Tag Historian and Annotations. |
In this section: