Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

datascript

< >

datascript is a query language created in 2014.

#363on PLDB 10Years Old
Download source code:
git clone https://github.com/tonsky/DataScript
Source Code

Immutable database and Datalog query engine for Clojure, ClojureScript and JS


Example from the web:
(require '[datascript.core :as d]) ;; Implicit join, multi-valued attribute (let [schema {:aka {:db/cardinality :db.cardinality/many}} conn (d/create-conn schema)] (d/transact! conn [ { :db/id -1 :name "Maksim" :age 45 :aka ["Max Otto von Stierlitz", "Jack Ryan"] } ]) (d/q '[ :find ?n ?a :where [?e :aka "Max Otto von Stierlitz"] [?e :name ?n] [?e :age ?a] ] @conn)) ;; => #{ ["Maksim" 45] } ;; Destructuring, function call, predicate call, query over collection

Language features

Feature Supported Example Token
Comments ; A comment
Line Comments ; A comment ;
Semantic Indentation X

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements

Built with Scroll v164.7.0