Questions tagged [datascript]

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

Datascript is immutable in-memory database and Datalog query engine written in Clojure and ClojureScript for Clojure, ClojureScript and JavaScript.

24 questions
0
votes
1 answer

datalevin db/id vs db/ident

I want to use Datalevin as a database for my app. The README mentions :db/id as the identifier of entities, and I see these do get an autoincremented integer value on insertion. However, there are also multiple mentions of :db/ident in the source…
erdos
  • 3,135
  • 2
  • 16
  • 27
0
votes
0 answers

Single Datascript Query Challenge in LogSeq

I'm trying to learn Datascript in the context of LogSeq, and I've stumbled into something I'm not sure how to solve. The Fundamental Problem I'm trying to query for a subset of entities that have NOT been referenced by attributes on a different…
FTWynn
  • 1,349
  • 2
  • 11
  • 11
0
votes
2 answers

Why logical "and" predicates do not work?

Tested on datascript 1.3.0 datoms: [{:db/id -1 :name "Smith" :firstname "Oliver" :age 20} {:db/id -2 :name "Jones" :firstname "Oliver" :age 20} {:db/id -3 :name "Smith" :firstname "Amelia" :age 16} {:db/id -4 :name "Jones" :firstname "Amelia"…
sof
  • 9,113
  • 16
  • 57
  • 83
0
votes
1 answer

How to query against attributes of multiple values?

Tested on datascript 1.3.0 datoms: [{:db/id -1 :name "Oliver Smith" :hobbies ["reading" "sports" "music"]}] tried to run the query below to find who like sports, but the empty set returned. '[:find ?name :where [?p :name ?name] [?p :hobbies…
sof
  • 9,113
  • 16
  • 57
  • 83
0
votes
1 answer

Wrapping Datascript query in a function?

Getting a seemingly bizarre problem with Datascript. For some reason when I run this query without it being wrapped in a function, everything works. But once I wrap it in a function, it returns the value for :block/content for every entity in the…
TomLisankie
  • 3,785
  • 7
  • 28
  • 32
0
votes
1 answer

In Datascript, how can I create a new attribute from the value of another?

Trying to create a new attribute where the value is the result of a transformation on a different attribute for the same entity. So, say I have a database where every entity has attribute :content. I want to have an additional attribute for every…
TomLisankie
  • 3,785
  • 7
  • 28
  • 32
0
votes
1 answer

How to write query to make result of a key with cardinality/many be a map while not a vector in datascript

Assume a datascript db has a schema: (def schema {:maker/cars {:db/cardinality :db.cardinality/many :db/valueType :db.type/ref}}) (def conn (d/create-conn schema) And has inserted some entities: {:db/id 1 :car/name…
dumeng
  • 67
  • 1
  • 5
0
votes
2 answers

How do I fill and display a list by Clojure Datascript?

i'm full my db with this (def fixtures [ [:db/add 0 :system/group :all] { :product/name "Donut Keurig" :product/category "snack" :product/brand "Grocery&GourmetFood" :product/height "2.1" :product/width "3.2" :product/notes "The…
-1
votes
0 answers

Challenges in webscraping

While scraping some websites I was not able to get the output. For example: from bs4 import BeautifulSoup import requests try: source = requests.get('https://www.mcmaster.com/91251A051/') source.raise_for_status() soup =…
1
2