asami

Asami, the graph database https://github.com/threatgrid/asami
quoll 2020-08-04T03:24:01.015600Z

There’s a new set of behaviors….

quoll 2020-08-04T03:24:36.015800Z

if you assert a set as a value, then it stores that as a multi-arity value

quoll 2020-08-04T03:24:49.016Z

if you have multiple values on an attribute, then it comes back as a set

quoll 2020-08-04T03:26:04.016200Z

so if you add:

{:db/ident "anna" :age 31}
and then transact:
{:db/ident "anna" :age 32}
Then when you get the “anna” entity, it will come back with:
{:age #{31 32}}

quoll 2020-08-04T03:27:08.016400Z

As already documented, if you wanted to replace it, you needed to transact:

{:db/ident "anna" :age' 32}

quoll 2020-08-04T03:27:22.016600Z

But the OTHER new thing, is that you can append to arrays now

quoll 2020-08-04T03:28:26.016800Z

So if you start with:

{:db/ident "anna" :age 31 :friends ["John" "Ringo" "Paul"]}
Then you can transact:
{:db/ident "anna" :friends+ "George"}
And when you get the “anna” entity again, you’ll retrieve:
{:age 31 :friends ["John" "Ringo" "Paul" "George"]}

quoll 2020-08-04T03:30:08.017200Z

It’s all in asami-1.1.0-SNAPSHOT. I’ll test it more heavily in the morning, and document it before I release it as 1.1.0