Fork me on GitHub
#fulcro
<
2017-11-12
>
urbank15:11:48

What would cause this error, using fulcro-sql? [fulcro-sql.core:148] - Unable to create Hikari Datasource: Cannot open <nil> as a Reader. Is there a repo with example usage of fulcro-sql?

urbank17:11:18

Ok, fixed that. Now I'm getting java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource

tony.kay18:11:43

You have to add the postgres driver to your project file. It's not a hard dependency of fulcro sql

tony.kay18:11:09

Database libraries rarely have the actual drivers in transitive dependencies…what if you’re using H2? You would not want a postgresql driver in your app making it bigger.

urbank18:11:12

@U0CKQ19AQ You're right. I'm just a bit ignorant on the topic. Also not very comfortable in the java ecosystem/config yet. Wanted to try clojure on a fullstack clojure app... previously just clojurescript. Fulcro seems perfect for this scenario.

tony.kay18:11:19

Cool. good luck. It is a lot to learn 🙂

tony.kay18:11:03

If you look at the project.clj file for fulcro-sql you’ll see the :provided dep for postgres

tony.kay18:11:12

just copy that over, and drop the provided marker

urbank19:11:37

Yup, it works now. Thanks

tony.kay18:11:45

So there have been a few people asking about running mutations in response to a result of server interactions. At the moment, the mutation-merge handling of Fulcro 1.0 is the way to do this. Technically, you can have a global atom that track your app (and thus the reconciler) so that you could transact from there if you had to. Ideally, you would trigger such a transact from setTimeout to avoid running a transact from within a running swap!. In general the Fulcro model is this: Run your mutation, follow it with a read if you really need to know something additional (or implement mutation merge). The read can have a post-mutation that further evolves the UI. I can see that from an abstract standpoint one might want to do more than react in the UI (e.g. the read might want you to trigger an additional mutation). Personally, I think you’re asking for trouble when you make your design that complex. Things get messy when you start making callbacks part of the model again, and I’ve been resistant to doing so, preferring to encourage us to be different and (hopefully) keep things simpler. However, I do get occasional requests from people to allow callbacks, and I do worry that I’m being too restrictive in this opinion. I’m open to the discussion, but I can tell you that it is going to take a compelling argument for callbacks to enter the API in any significant form. “Because that’s what I’m used to” isn’t good enough. I’m interested in Fulcro being general purpose. But I’m also very interested in it not degrading to the mess that a lot of other libraries make.

tony.kay18:11:08

I’d very much appreciate discussion of the form “use-case XYZ…here’s how I am used to doing it. Here’s how I have to do it in Fulcro (or I don’t see how).” Then discuss the pros/cons of the alternatives.