Fork me on GitHub
#fulcro
<
2022-03-30
>
sheluchin15:03:52

Is there a RAD attribute type for a collection? Something that could be used for a set like :account/phone-numbers, where it doesn't need to exist in some other model and get accessed as a :ref. :enum sounds more like a set of multiple choice options, so I guess that's not it.

tony.kay16:03:41

What you are looking for is probably type :string with :cardinality :many

tony.kay16:03:00

Datomic models those just fine, and they in fact have set semantics

sheluchin16:03:58

I'm on xtdb but I'd guess the intended behaviour is similar, if supported. I will try that out. I thought :cardinality was just intended for :ref types, but the docs are clear: > Supported when the type of the attribute is :ref, and some database adapters may support it on other types. Thanks @U0CKQ19AQ!

👍 1
tony.kay16:03:41

Really it is up to the db adapter…SQL has array types on columns, for example. You can always encode what you want somehow. I don’t know enough about XTDB, but can’t you just put a set on an attribute? {:account/phone-numbers #{…}}

tony.kay16:03:03

I know it is a document db on clj data, so that would be my first thing I’d try

sheluchin16:03:06

In the backend that's exactly what intending to do. The storage part is clear. And I can always just make it a ref type and have the resolver return the set stored on that key in the document. I wasn't sure if any of the base RAD attribute types would align with it properly. I guess :string with :many should be the way to use a set on the attribute.

Jakub Holý (HolyJak)15:03:29

I don't think so since eg a general sql DB wouldn't know how to store that. But you can create your own types, I suspect?

sheluchin15:03:29

Not something I've done before but I suspect that's the way forward. Just wanted to check if there was a common approach people are using already.

Brian Marco19:03:25

I'm new to fulcro and I'm trying to get the fulcro-template running. When I run (start) in the developments ns in the repl the chromium console gives me GET net::ERR_ABORTED 404 (Not Found)

1
Tyler Nisonoff20:03:45

did you compile the front-end with shadow? https://book.fulcrologic.com/#_build_it

Tyler Nisonoff20:03:17

should see something built at

resources/public/js/main/main.js
if you’re using the default set-up

Brian Marco20:03:01

That was it, thanks. I missed half a step in the README

Jakub Holý (HolyJak)06:03:50

Welcome to Fulcro! I ma glad Tyler was able to help you. PRs making the steps harder to miss are always welcome 🙂 You being a newbie, I would like to pick your brain if you will 🙂 How did you come to Fulcro? And how have your learned it so far? 🙏