SignalSQL

SQL support

SignalSQL implements a practical subset of SQL through a Flex/Bison parser. This page summarises what you can rely on today. Because the server speaks the MySQL wire protocol, statements are issued exactly as they would be against MySQL.

Data statements

  • SELECT — projection, WHERE, and SELECT DISTINCT. Prepared statements and parameter binding are supported.
  • INSERT — INSERT INTO <table> VALUES (...).
  • UPDATE — UPDATE <table> SET col = ... WHERE ....
  • DELETE — DELETE FROM <table> WHERE ....
SELECT * FROM INPUT;
SELECT DISTINCT Name FROM INPUT;
UPDATE setpoints SET Value = 67.0 WHERE Name = 'hlt';
DELETE FROM PID WHERE ID = 1;

SELECT DISTINCT preserves first-seen row order and powers Grafana template variable dropdowns built from SELECT DISTINCT col ….

Schema statements

CREATE TABLE test2 (
  ID    INT AUTO_INCREMENT PRIMARY KEY,
  Name  VARCHAR(255),
  Value double REFERENCE
);

DROP TABLE test2;

Not supported: SignalSQL has a single database (main) — CREATE DATABASE is unavailable — and does not support CREATE VIEW. See Limitations.

Introspection

  • SHOW TABLES lists base tables, including the tables exposed by hardware modules.
  • An INFORMATION_SCHEMA-style system catalog is bootstrapped at first run, so standard tooling (phpMyAdmin, Grafana) can introspect the schema.

Types

Common column types are available, including integer types, DOUBLE, and VARCHAR(n). A DOUBLE REFERENCE column is the usual choice for values that resolve to a numeric sensor reading or another column.

Storage

Tables are backed by LMDB for durability; the engine also uses in-memory tables for query results and scratch data. See Configuration for the data directory.

Prepared statements

Prepared statements work over the MySQL protocol, so client-side placeholders (?) bind as expected — including when reading through a REFERENCE column, where the resolved value is returned with its native type.