{"repo":"datopia/invariant","free":true,"listed":false,"github":"https://github.com/datopia/invariant","clone":"git clone https://github.com/datopia/invariant.git","description":"This repository provides invariant verification in Datalog for immutable databases like Datahike.","language":"Clojure","stars":11,"topics":["datalog","verification","analysis","clojure","datomic","datahike","database"],"license":null,"category":"databases-storage","readme_excerpt":"Invariant A library for enforcing data integrity in Datalog databases like Datahike by defining and validating invariants on attributes. Overview Invariant extends Datalog databases with a powerful system to enforce domain-specific constraints on transactions. Unlike simple schema validation, invariants in this library can: - Validate relationships across multiple entities - Ensure consistent state transitions - Enforce complex business rules - Prevent data corruption in multi-step transactions All invariants are defined as Datalog queries that run against multiple database states to validate transactions before they're committed. Key Features - Declarative Invariants : Define constraints using familiar Datalog query syntax - Transaction Validation : Automatically check transactions against relevant invariants - Context-Aware : Evaluate invariants against current state, future state, and transaction data - Safety Checks : Prevent unsafe queries from being used as invariants - Extensible : Designed to work with multiple Datalog database implementations How It Works Invariants are stored in the database as entities with :invariant/rule and :invariant/query attributes. When a transaction is submitted: 1. The system identifies which attributes are affected 2. Relevant invariants for those attributes are loaded 3. For each invariant: - A query is run against multiple database views: - $before : The current database state - $after : The database after applying the transaction - $em","default_branch":null,"files":null,"tree":[],"storefront":"/r/datopia","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/datopia/invariant/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}