https://github.com/michelp/pgfsm
Simple SQL finite state machine for Postgres
https://github.com/michelp/pgfsm
Last synced: 7 months ago
JSON representation
Simple SQL finite state machine for Postgres
- Host: GitHub
- URL: https://github.com/michelp/pgfsm
- Owner: michelp
- License: cc0-1.0
- Created: 2016-04-17T18:40:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-05-14T01:01:08.000Z (about 1 year ago)
- Last Synced: 2025-05-14T02:53:13.200Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 825 KB
- Stars: 70
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pgfsm
Simple SQL finite state machine for Postgres
This is some example code on how to store a simple state machine in
SQL.
There are two tables, fsm.machine and fsm.transition. The machine
table has insert and update triggers to ensure that every row is in a
valid state. The transition table is where transition between states
are defined.
There is a pgtap test in test.sql that illustrates the technique.