Fork me on GitHub

Hi all. Is there a library I can use to dynamically generate DDL queries? I'm using MSSQL Express (I have to). I've looked at honeysql but it seems its meant for DML queries.


You can extend it to support any type of queries.


Hi, I have a design question in general. When you implement a protocol to a existing type, what is the better way to handle nil? I choose to implement the protocol to handle it, but is this a good way?


I guess that the alternative is extend-type Object (they're not the same) Maybe I'd consider extend-type Object cleaner, because generally a nil reference represents a bug elsewhere, which I would better prevent with other tools (e.g. something similar to a type system)


@U45T93RA6 Thanks for your suggestion. I'll try it!


I'm building a tuple space service. I've implemented the "tuple space" bit now I need to figure out how to provide a service. A few years ago when I was doing Clojure last I would probably have reached for Liberator and made it a RESTful web service but I am wondering what whether that is still a good pattern. Maybe there are other, better, options than REST web service that exist now, any thoughts?


Cool, early on in my career I worked with JINI and JavaSpaces. Have always thought what a more "modern" tuple space might look like.


I got to play with Javaspaces and IBM T-Spaces for a while, what's shocking is that it's almost all gone. Links broken, stuff disappeared.


I'm not sure what I am doing is essentially very "modern" 🙂


I'm building it to act as the collaboration layer for a Mac app I've been building, allowing local agents to communicate with each other


I looked at building some kind of tightly woven-collaborative layer using Parse as a backend and then remembered using Tuple Spaces and thinking how interesting it could be. In particular the way you could easily pipe data from other services into a space to have it consumed by an agent


you want to make it a REST service, or something else?


Not necessarily no, I am wondering what kinds of things people are using to build services these days.


I've tried to improve my question to be clearer what I am asking.


GraphQL is the newest thing. It depends on the use case. I’m a big fan of HTTP (and thus REST). (Disclaimer: liberator’s author speaking)


Hi Philipp. Thanks. I don't perceive GraphQL to be a good fit here because my data is flat tuples. It would be natural for me to use HTTP/Liberator and the interface is very simple. Maybe that's the easiest route. What web stack do you tend to use these days?


It depends. Naturally liberator or lacinia. I like pedestal as the underlying http server.


I'll take a look at pedestal, thanks


Okay this looks idea, thanks


@U054UD60U the Liberator tutorial starts with ring & compojure — I am assuming that Pedestal changes this picture somewhat?


Yes indeed. But you can use any ring handler function with pedestal. Liberator resource are ring handler functions in the end.


Ah, ok. Good to know, thanks.


@U054UD60U one question. A tuple space operation may block, waiting for a matching tuple. Now I can implement block in the client by polling the server but that feels like the wrong approach. Feels like the wrong pattern. Does that detail change your view?


hmmm, so HTTP supports long running requests but beware of timeouts. Maybe Server-Send Events is what you’re looking for. Supported by pedestal with async and liberator can generate them, too


Interesting, I had never come across these before. Thanks for the pointer.


Is there a way in clojure.test to get fixtures (a la use-fixtures) to run between each (testing ...) form and not just each deftest?


This is something I wanted in the past (I even created an issue for it in clj's jira), but the answer is no, you can't. (A couple years later, I don't want this anymore... I like testing merely as an informative marker) But you can implement your own testing with its own fixture system (which may complement c.t's one)


Makes sense. I assumed as much and restructured my tests to use separate deftests.

Alex Miller (Clojure team)15:07:47

no, it's on test function granularity