Fork me on GitHub

Well, it's definitely an "adapter" of some sort, since it takes a builder and returns a new builder. The current adapters are as-maps-adapter and as-arrays-adapter and those have the map/array logic built-in (as well as simply wrapping/delegating everything except with-column -- that's the behavior they "adapt"). I guess this is sort of an interceptor-adapter in that sense (of "hooks") but it doesn't actually change the behavior of the wrapped adapter -- beyond optionally calling side-effecting functions at certain points.


Names are hard.


AFAIK, middleware/interceptors can alter the inputs and/or outputs? My connotation of hooks is that they are triggered by things, but don’t alter the thing itself. Maybe I am wrong about that...


@dcj Thanks. Yeah. Interceptor isn't really right either. And it's not really middleware (although that introduces some interesting possibilities if I went in that direction instead).


add-builder-hookfns 🙂


I may yet go for something more middleware-like, rather than just part of the builder machinery, since that would also let you do timings. When I started out down this path this morning, I was thinking more of a "wrapper" namespace, and one of the "problems" I want to solve is to provide some relatively clean, simple way to do something that would allow default options to be provided across the whole API.


The builder wrapper/adapter/hooker(!) is the only way to "get at" each row as it is built, but maybe that's not important...


Hi @seancorfield, any chance of cutting a new release that includes the updated dep on


oh, and good point about the unqualified names! 🙂


I didn't think about that one!


@dharrigan as soon as I've decided how to proceed with the middleware/hook thing and documented that. So, "soon".


You can always add an explicit dep on the most recent to solve the reflection stuff etc for the time being.


(apologies if this isn’t the right channel for this particular question) I’m running a test and getting the following error when I do:

org.postgresql.util.PSQLException: ERROR: null value in column "alliance_id" violates not-null constraint
  Detail: Failing row contains (7, null, 32, 2).
However, I’ve removed every reference to alliance_id in that test file. I’m guessing that a call to a function in another file is what is causing this problem. I’m looking at the stacktrace provided but I’m not seeing anything that points to what file may be causing the error. Is there something else I can do that will help inform where the problem lies?


@darrell You'll need to provide us with a lot more information for us to be able to help. Based on just that error, I'd say you're trying to insert a row into a database table that has a column called alliance_id that column is declared not null. So either it's the second column (where you're passing nil) or its another column that you're not even trying to insert a value into.


What does your insert code look like and what is the table structure?