Category: Languages and automation
-
Reactive and dataflow programs using SQLite — Part 3: Reacting to data changes
In part 2, we explored parallels between SQL and Prolog and saw how to use a view like a logic query, that is, to ask questions that always use the most up-to-date inputs. In this part, we’ll introduce a new facility called triggers, which are SQLite’s way of running an action in response to incoming…
-
Reactive and dataflow programs using SQLite — Part 2: Prolog as a database
Update: Code blocks on this post are now live. you can edit and run them thanks to the wonderful Codapi and CodeMirror projects, running locally in your browser via WASM. In this second post we will look at the parallels between logic programming and databases, and between views in a relational database and reactive programs.…
-
Reactive and dataflow programs using SQLite — Part 1: A bit of background
tldr: Using views and triggers (interfacing with a host runtime like Python), it is possible to implement a neat reactive/dataflow system in plain old SQLite. Inputs like events and user data are continuously transformed to outputs like commands using relational logic. We take a look at how easy it is to build a small example…