tonsky / datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Eclipse Public License 1.0
5.45k stars 304 forks source link

Attribute of composite tuple starting with colon is not working in js #437

Open NiaMori opened 1 year ago

NiaMori commented 1 year ago

Description

Attribute of composite tuple starting with colon is not working in js

Reproduction

A minimal reproduction is provided on stackblitz

const d = require('datascript')

const db = d.db_with(
  d.empty_db({ 'a+b': { ':db/tupleAttrs': [':a', 'b'] } }),
  [{ ':a': 'A', b: 'B' }]
)

console.log(d.q('[:find ?e ?a+b :where [?e "a+b" ?a+b]]', db))

Actual Output

[ [ 1, [ null, 'B' ] ] ]

Expected Output

[ [ 1, [ 'A', 'B' ] ] ]

Version

Maybe Related

422

tonsky commented 1 year ago

Thanks for reporting!