datascript icon indicating copy to clipboard operation
datascript copied to clipboard

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

Open NiaMori opened this issue 3 years ago • 1 comments

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

  • datascript: 1.3.15

Maybe Related

#422

NiaMori avatar Oct 11 '22 05:10 NiaMori

Thanks for reporting!

tonsky avatar Oct 13 '22 17:10 tonsky