An Ignition Gateway can create a SQLite database, allowing for data collection without installing a separate SQL database. This is ideal for small scale applications, as well as testing and demonstrations.
SQLite connections offer convenience, but Relational Database Management Systems (RDBMS) generally offer better performance, especially so in cases where queries are frequently executed such as systems utilizing a historian system. As a result, the SQLite connection is not recommended for production systems as a historian database. Learn more about appropriate uses of SQLite in their official documentation.
Unlike other database connections, SQLite databases only support a single connection at a time. Configuring this type of Database Connection means the Gateway will constantly be connected to the SQLite database, preventing other systems from connecting.
SQLite Connect URL
Ignition Gateways can configure a SQLite database connection without any additional installation. This is because the driver will create a file (which is the SQLite database) at the directory specified in the Connect URL property. Pointing the Connect URL to an existing IDB file will cause the connection to access the existing tables within the file. All Connect URLs must start with the following pattern:
Followed by the destination to the database file.
# On Windows
jdbc:sqlite:C:/Path/To/File.db
# On Linux
jdbc:sqlite:/path/on/linux/File.db
Note: For Windows machines, either forward / or backslashes\ can be used.
Storing to Memory
Instead of creating a file, the Connect URL can specify that data should be stored in memory. As expected, this is not an ideal solution for systems that require any sort of long term storage, but can be useful in cases where data should be ephemeral.
Relative Paths
The following feature is new in Ignition version
8.1.10
Click here to check out the other new features
SQLite database connections feature several keywords that represent relative locations within Ignition's installation directory.
Keyword | Description |
---|
${data} | Represents the Gateway's "data" directory at /usr/local/ignition/data/. |
${local} | Represents the Gateway's "local" directory at /usr/local/.
Note: SQLite files created in this directory will not be included in gateway backup files. If you wish for a GWBK to include the SQLite file, then set the path to another location within the data directory, but outside of the local file.
|
In both cases, additional folders can be added after the keyword. The example below would create "Folder" in the gateway's data directory, and place the DB file in the Folder.
jdbc:sqlite:${data}/Folder/File.db