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.
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: