Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

RyLabs SQLite Database Library

Overview

The RyLabs SQLite Database Library is a compact library that wraps the functionality of the SQLite database engine in LabVIEW. The database library implements a cross-platform, serverless and self-contained SQL database (*.db). This toolkit is packed into a single LabVIEW Class so all dependencies are automatically included in an application build. With a small foot, this library includes the ability to bind parameters and recall SQL transactions to increase the performance.

 

Palette

The RyLabs SQLite Database Library is installed to the Addons > RyLabs > SQLite palette. The palette is partitioned into database and transaction VIs. Property nodes are used to bind and collect values by stepping through SQL queries.

RyLabs SQLite Palette.png

 

 

Block Diagram

SQLite uses the basic SQL schema to execute transactions from a database file (*.db).

RyLabs SQLite Block Diagram.png

For efficency, SQL transactions can be reused and optimized through the use of binding and column steps. First a savepoint is created, then a SQL statement is prepared with the use of binding parameters ("?"). Property nodes are used to index through the bindings, for each insert in this example the SQL statement is reset and the transaction executes again with a new employee.

RyLabs SQLite Binding.png

By default SQLite only supports large integers (U64), floats (DBL), strings (String), and binary large objects (String). Timestamps were added as either string or float data types. Unlike most database schemas dataypes are not strictly typed, this means that column types will dynamically adjust to the expected type queried.

 

RyLabs SQLite PropertyNodes.png

Examples

The RyLabs SQLite Database Library comes with two drag-n-drop examples from the palette. The first creates executes and queries a basic SQL statement. The second shows an example on how to use binding parameters and collumn steps to efficiently query the database.

RyLabs SQLite Example 2.png

Requirements

- LabVIEW 2013 or later

- VI Package Manager 2014 or later

 

References

Refer to https://www.sqlite.org for more information on SQLite's database engine.

Note: It wasn't until I almost finished this toolkit that James Powell's SQLite Library is also available.

Author

Ryan Pacini

Certified LabVIEW Architect | RyLabs.com

Comments
drjdpowell
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Great minds think alike.