Christopher Ng
Christopher Ng
Hmm...it seems I was missing some context. So my 'other example' wasn't great because as you say it would mess badly with pure 'library' codebases. Possibly it could be used...
Ok thanks for the feedback. I'll see how I go and whether it really does create a lot of noise across our projects before I decide if it warrants a...
ha, slightly confusing, my actual name is chris too lol. it hasn't been hugely burdensome so far 'just fixing it' when necessary, i haven't yet given up and disabled it...
you already have: ``` public static Template prepareToUpdate( Connection connection, @CompileTimeConstant String template) { return prepare(connection, template, PreparedStatement::executeUpdate); } ``` It could use `PreparedStatement::addBatch` instead and then perhaps return a...
cheers. btw poking around in the source, should the `Template` be closing the cached `PreparedStatements`?
yeah, it would. just seems a bit...untidy.
yeah, that's what i'm doing at the moment. i guess the only other thing i'd point out is that with: ``` PreparedStatement stmt = cached.computeIfAbsent(sql.toString(), s -> { }); try...
no, that's code from within `prepare` in `SafeSql`: https://github.com/google/mug/blob/79f2f9d22bcde5f27e513348a7128d05ce22e328/mug-safesql/src/main/java/com/google/mu/safesql/SafeSql.java#L1875